Hi All,
Have a simple enough question.
I have created a default style setting for all my MS Word documents. I have recorded a simple macro to change the styles in an existing document into my default style. My question is how do I reference the currently opened document without needing its location path. i.e. change Destination Path from "Z:\Projects\Existing Document Path.docx" to Currently opened document.
Hope this makes sense.
Have a simple enough question.
I have created a default style setting for all my MS Word documents. I have recorded a simple macro to change the styles in an existing document into my default style. My question is how do I reference the currently opened document without needing its location path. i.e. change Destination Path from "Z:\Projects\Existing Document Path.docx" to Currently opened document.
Hope this makes sense.
Code:
Sub AA_Font()
'
' AA_Font Macro
'
'
With ActiveDocument
.UpdateStylesOnOpen = False
.AttachedTemplate = "Normal"
.XMLSchemaReferences.AutomaticValidation = True
.XMLSchemaReferences.AllowSaveAsXMLWithoutValidation = False
End With
Application.OrganizerCopy Source:= _
"C:\Users\UserName\AppData\Roaming\Microsoft\Templates\Normal.dotm", _
Destination:= _
"Z:\Projects\Existing Document Path.docx" _
, Name:="Normal", Object:=wdOrganizerObjectStyles
Application.OrganizerCopy Source:= _
"C:\Users\UserName\AppData\Roaming\Microsoft\Templates\Normal.dotm", _
Destination:= _
"Z:\Projects\Existing Document Path.docx" _
, Name:="AA Appendix", Object:=wdOrganizerObjectStyles
'Etc...
EndSub
Last edited: