When a new document is created the styles from the template it was based on are copied to the document.
When you attach a template and update styles only the styles that are flagged as in use will be updated.
The purpose of UpdateStylesOnOpen
is to either:
- update the styles in a document because the template it was originally based on has been updated.
- overwrite changes the user has made to styles in the document.
So if you want a new document to contain the correct styles you should start by creating it from the correct template.
EDIT:
AutoNew
will affect every new document however it is created, so if it is your intention that all new documents are based on a specific template a better approach would be to intercept the FileNewDefault
command (New File icon on the Quick Access Toolbar or Ctrl+N).
Public Sub FileNewDefault
Documents.Add Template:=<path to template>
End Sub
If you insist on treating the effect rather than tackling the cause then you can modify AutoNew
as follows:
Public Sub AutoNew
ActiveDocument.AttachedTemplate = <Path To Template>
ActiveDocument.UpdateStyles
End Sub
However, if you do take this approach you should first read the Word MVP's article on UpdateStyles
to ensure that you understand the limitations of this approach.