When you say application not path name I assume you mean the two files are open in Word. This macro uses the style organiser to copy the styles defined or modified in the active document to all other open documents:
Dim oStyle As Style
Dim oDocument As Document
For Each oDocument In Application.Documents
If oDocument.Name <> ActiveDocument.Name Then
For Each oStyle In ActiveDocument.Styles
If oStyle.InUse Then
Application.OrganizerCopy _
ActiveDocument.Name, _
oDocument.Name, _
oStyle.NameLocal, _
wdOrganizerObjectStyles
End If
Next oStyle
End If
Next oDocument
To write the macro select Tools->Macro->Macros, enter a name for the macro in the name box, select Normal.dot in the Macros In box and click Create. Copy the above code into the editor between SUB and END SUB. Close the editor. Run the macro by going back to Tools-Macro->Macros, select the macro and click Run.
I get an error of file not found
The code breaks
at: Application.OrganizerCopy _
ActiveDocument.Name, _
oDocument.Name, _
oStyle.NameLocal, _
wdOrganizerObjectStyles
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.