Change the template for an existing document

R

Raul

I need to change the template for a number of existing documents. Can anyone
tell me how to programmatically change the document template from normal.dot
to newtemplate.dot and then save the document (i.e., overwrite the original
file)?

I have tried unsuccessfully to do this manually.

Thanks in advance,
Raul
 
L

Lene Fredborg

To attach the new template to the active document and save the document (you
need to specify the full path to newtemplate.dot):

With ActiveDocument
'Replace "C:\Templates\" below with the correct path
.AttachedTemplate = "C:\Templates\newtemplate.dot"
.Save
End With

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word
 
R

Raul

Thank you Lene.

The new template (newtemplate.dot) has headers and footers. When I looked
at the active document after I ran the code I did not see the expected
headers and footers. What am I missing?

Thanks,
Raul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top