Saving changes to the Normal template programatically

D

DZ

Greeting

Is the there a way to save the changes to the Normal
template, programatically.

I want to do this because a run macros that change the
normal template and i want to save the changes immediately
instead of waiting until i close word.

Thank you.

DZ
 
P

Peter Hewett

Hi DZ

The following code will do the trick. However, you need to decide
how/where/when the procedure is called.

Because it checks that the ActiveDocuments attached template is Normal.dot
you can call the procedure for any document and let the procedure decide
whether Normal.dot needs saving:

Public Sub SaveNormalTemplate()
With ActiveDocument.AttachedTemplate
If StrComp(.Name, "normal.dot", vbTextCompare) = 0 Then
.Save
End If
End With
End Sub

HTH + Cheers - Peter
 
W

Word Heretic

G'day "DZ" <[email protected]>,

Templates("Normal.dot").Save


Steve Hudson
Word Heretic Sydney Australia
Tricky stuff with Word or words

Email: WordHeretic at tpg.com.au


DZ was spinning this yarn:
 

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