A family of Microsoft word processing software products for creating web, email, and print documents.
Use the following code
ActiveDocument.AttachedTemplate = "Normal.dotm"
ActiveDocument.UpdateStyles
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I know how to import all the styles from the normal.dotm by using the organizer, but how can I do this thru VBA? I've googled search but can't seem to find this one.
Normal.dotm in the left side of the window.SomeDoc.dotm in the right side of the window.Styles which you wan to copy from the left window(in Normal.dotm).Copy.A family of Microsoft word processing software products for creating web, email, and print documents.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Answer accepted by question author
Use the following code
ActiveDocument.AttachedTemplate = "Normal.dotm"
ActiveDocument.UpdateStyles
Answer accepted by question author
If your attached template is a different template and you want to retain that attachment, you can use:
Sub CopyNormalTemplateStyles()
'
Dim strCurrentTemplate As String
Let strCurrentTemplate = ActiveDocument.AttachedTemplate.fullname
'
ActiveDocument.AttachedTemplate = "Normal.dotm"
ActiveDocument.UpdateStyles
ActiveDocument.UpdateStylesOnOpen = False
ActiveDocument.AttachedTemplate = strCurrentTemplate
'
End Sub
Thank you to both. This worked great.