View Single Post
 
Old 08-31-2021, 09:24 PM
Bikram Bikram is offline Windows 10 Office 2007
Advanced Beginner
 
Join Date: Jul 2021
Location: Nepal
Posts: 94
Bikram is on a distinguished road
Question Importing styles using Templates

I am using a document template to import styles in a document using
Sub Macro7()
'
' Macro7 Macro
'
'
With ActiveDocument
.UpdateStylesOnOpen = True
.AttachedTemplate = _
"C:\Users\aspBikram\AppData\Roaming\Microsoft\Temp lates\Physics_Styles.dotm"
.XMLSchemaReferences.AutomaticValidation = True
.XMLSchemaReferences.AllowSaveAsXMLWithoutValidati on = False
End With
End Sub

It worked awesomely but once I finalized the files and then close it and open again to edit some texts the formatting done after importing the styles would have already reversed. I want to avoid updatestylesonopen but when I set it to false I would have to manually reapply and update each style. Here, what I want is to update styles but only once(not for each time the document is opened). Can anyone guide me on how to do that??
Reply With Quote