M
mikewillnot
With Word 2003, I have a customized Comment Text style in my
normal.dot template that I'd like to use in every document I open.
The only way I can see to make that happen is by manually copying the
style, using the organizer, from normal.dot to the active document.
I'd like to automate this. I used Macro Recorder, and get the code
below, but it only works on this particular open document. I tried
adjusting it to copy to whatever the activedocument is, but couldn't
get anything to work. Any suggestions would be greatly appreciated.
THANKS.
Sub aaa__copy_style_to_activedoc()
'
With ActiveDocument
.UpdateStylesOnOpen = False
.AttachedTemplate = "Normal"
.XMLSchemaReferences.AutomaticValidation = True
.XMLSchemaReferences.AllowSaveAsXMLWithoutValidation = False
End With
Application.OrganizerCopy Source:= _
"C:\Documents and Settings\williamsmi\Application Data
\Microsoft\Templates\Normal.dot" _
, Destination:= _
"[filepathandname]" _
, Name:="Comment Text", Object:=wdOrganizerObjectStyles
End Sub
normal.dot template that I'd like to use in every document I open.
The only way I can see to make that happen is by manually copying the
style, using the organizer, from normal.dot to the active document.
I'd like to automate this. I used Macro Recorder, and get the code
below, but it only works on this particular open document. I tried
adjusting it to copy to whatever the activedocument is, but couldn't
get anything to work. Any suggestions would be greatly appreciated.
THANKS.
Sub aaa__copy_style_to_activedoc()
'
With ActiveDocument
.UpdateStylesOnOpen = False
.AttachedTemplate = "Normal"
.XMLSchemaReferences.AutomaticValidation = True
.XMLSchemaReferences.AllowSaveAsXMLWithoutValidation = False
End With
Application.OrganizerCopy Source:= _
"C:\Documents and Settings\williamsmi\Application Data
\Microsoft\Templates\Normal.dot" _
, Destination:= _
"[filepathandname]" _
, Name:="Comment Text", Object:=wdOrganizerObjectStyles
End Sub