April 9, 2024
Contribute to the Microsoft 365 and Office forum!
Click here to learn more 💡
May 10, 2024
Word Forum Top Contributors:
Macro to import styles
Report abuse
Thank you.
Reported content has been submitted
If you attach your new normal template to the documents, with the updatestyles on open option set, it should achieve what you require.
The following should do the job
With ActiveDocument
.UpdateStylesOnOpen = True
.AttachedTemplate = "Normal"
.UpdateStylesOnOpen = False
End With
http://www.gmayor.com/installing_macro.htm
If this achieves what you require, with a little modification you can use this as a custom process with http://www.gmayor.com/document_batch_processes.htm i.e.
Function ApplyTemplate(oDoc As Document) As Boolean
On Error GoTo Err_Handler
With oDoc
.UpdateStylesOnOpen = True
.AttachedTemplate = "Normal"
.UpdateStylesOnOpen = False
End With
ApplyTemplate = True
lbl_Exit:
Exit Function
Err_Handler:
ApplyTemplate = False
Resume lbl_Exit
End Function
For more Word tips and downloads visit my web site
https://www.gmayor.com/Word_pages.htm
Report abuse
Thank you.
Reported content has been submitted
2 people found this reply helpful
·Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
It did not work for me. I created the macro as follows:
With ActiveDocument
UpdateStylesOnOpen = True
AttachedTemplate = "Normal"
UpdateStylesOnOpen = False
End With
But when I run it, it does not import the styles. Am I missing somenting. I installed the macro in a document. Should I install it in normal.dot?
Report abuse
Thank you.
Reported content has been submitted
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
Question Info
Last updated October 5, 2021 Views 401 Applies to: