#102116 - 2003-06-13 08:51 PM
Re: Open a created word doc, with a template...
|
kholm
Korg Regular
   
Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
|
cmarti
Maybe you can use this.
The following code will attach the template: E:\MiscInfo.dot to the document: E:\invoices\miscinfo\mydoc.doc using the function: ChangeTemplate()
Some strange things to observe: - The document can be protected and the attached template is stil changed. - BUT the template you attach may not be protected ???
So if the template is protected you must unprotect it before running the script, and protect it again when you are finished.
code:
Break On ChangeTemplate("E:\invoices\miscinfo\mydoc.doc","E:\MiscInfo.dot") Function ChangeTemplate($Document,$Template) Dim $oWord $oWord = CreateObject('Word.Application') $RC = $oWord.Documents.Open($Document) $oWord.ActiveDocument.AttachedTemplate = $Template $oWord.ActiveDocument.Save $oWord.Application.Quit(0) EndFunction
-Erik [ 13. June 2003, 21:15: Message edited by: kholm ]
|
|
Top
|
|
|
|
Open a created word doc, with a template...
|
cmarti
|
2003-06-13 04:34 PM
|
Re: Open a created word doc, with a template...
|
Lonkero
|
2003-06-13 04:43 PM
|
Re: Open a created word doc, with a template...
|
cmarti
|
2003-06-13 04:48 PM
|
Re: Open a created word doc, with a template...
|
Radimus
|
2003-06-13 04:53 PM
|
Re: Open a created word doc, with a template...
|
Lonkero
|
2003-06-13 04:56 PM
|
Re: Open a created word doc, with a template...
|
cmarti
|
2003-06-13 04:59 PM
|
Re: Open a created word doc, with a template...
|
Shawn
|
2003-06-13 05:03 PM
|
Re: Open a created word doc, with a template...
|
cmarti
|
2003-06-13 05:09 PM
|
Re: Open a created word doc, with a template...
|
Shawn
|
2003-06-13 05:14 PM
|
Re: Open a created word doc, with a template...
|
cmarti
|
2003-06-13 05:17 PM
|
Re: Open a created word doc, with a template...
|
Shawn
|
2003-06-13 05:18 PM
|
Re: Open a created word doc, with a template...
|
cmarti
|
2003-06-13 05:21 PM
|
Re: Open a created word doc, with a template...
|
Lonkero
|
2003-06-13 06:59 PM
|
Re: Open a created word doc, with a template...
|
cmarti
|
2003-06-13 08:17 PM
|
Re: Open a created word doc, with a template...
|
kholm
|
2003-06-13 08:51 PM
|
Re: Open a created word doc, with a template...
|
NTDOC
|
2003-06-13 09:22 PM
|
Re: Open a created word doc, with a template...
|
cmarti
|
2003-06-13 09:39 PM
|
Re: Open a created word doc, with a template...
|
cmarti
|
2003-06-13 09:49 PM
|
Re: Open a created word doc, with a template...
|
NTDOC
|
2003-06-13 09:53 PM
|
Re: Open a created word doc, with a template...
|
NTDOC
|
2003-06-13 11:01 PM
|
Re: Open a created word doc, with a template...
|
NTDOC
|
2003-06-14 10:01 AM
|
Re: Open a created word doc, with a template...
|
kholm
|
2003-06-14 10:57 PM
|
Re: Open a created word doc, with a template...
|
NTDOC
|
2003-06-16 09:56 AM
|
Re: Open a created word doc, with a template...
|
cmarti
|
2003-06-16 04:24 PM
|
Re: Open a created word doc, with a template...
|
cmarti
|
2003-06-16 04:50 PM
|
Re: Open a created word doc, with a template...
|
cmarti
|
2003-06-20 08:17 PM
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
1 registered
(Allen)
and 483 anonymous users online.
|
|
|