#102121 - 2003-06-13 11:01 PM
Re: Open a created word doc, with a template...
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11629
Loc: CA
|
cmarti,
This code is VERY close to working. Not quite, but close.
What I "think" is happening is that the DOC1.DOC is open, copies data, but then never switches to the .DOT Then does a Save-AS to DOC4.DOC from DOC1.DOC
Maybe someone else can work on it with you. I don't have any more time today to look at it.
code:
break on ChangeTemplate("C:\Temp\test1.doc","C:\Temp\miscinfo.dot") Function ChangeTemplate($Document,$Template) Dim $oWord $oWord = CreateObject('Word.Application') $RC = $oWord.Documents.Open($Template) $RC = $oWord.Documents.Open($Document) $oWord.Selection.WholeStory $oWord.Selection.Copy $oWord.ActiveDocument = $Template $oWord.Selection.PasteAndFormat("wdPasteDefault") $oWord.ChangeFileOpenDirectory("C:\temp\") $oWord.ActiveDocument.SaveAs("Doc4.doc", 0) $oWord.Application.Quit(0) EndFunction
|
|
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
|
0 registered
and 765 anonymous users online.
|
|
|