I finally sat down and wrote the code to import styles from a global template into the current document. It is posted as A Global StyleSheet in Word? (addbalance.com/word/stylesheet.htm for future reference)
Here’s the code, without all the error handlers and comments:
Sub StyleCopyMacro() ' StyleCopy Macro written by Charles Kyle Kenyon 14 November 2001 ' Copyright 2001 All rights reserved Dim sThisTemplate As String Dim sTargetDoc As String Dim i As Integer Dim iCount As Integer Dim rResponse As Variant sThisTemplate = ThisDocument.FullName sTargetDoc = ActiveDocument.FullName rResponse = MsgBox(Prompt:="This command redefines your Body Text Style and" _ & vbCrLf & "Heading Styles 1-9. Are you sure you want to do this?" _ & vbCrLf & vbCrLf & "If you are not sure, answer 'No' and " _ & "make a backup of your document." _ & vbCrLf & "Then run the command to copy the styles again.", _ Title:="Are you sure you want to redefine your styles?", _ Buttons:=vbYesNo + vbExclamation) If rResponse = vbNo Then Exit Sub For i = 1 To 3 With Application .OrganizerCopy Source:=sThisTemplate, _ Destination:=sTargetDoc, Name:="Body Text", Object:= _ wdOrganizerObjectStyles For iCount = 1 To 9 .OrganizerCopy Source:=sThisTemplate, _ Destination:=sTargetDoc, Name:= _ "Heading " & iCount, _ Object:=wdOrganizerObjectStyles Next iCount End With Next i End Sub
The key for me was the discovery of the ThisDocument object as a way to refer to the global template. That way, you don’t have to know where the user will stick the template or what name it will have, just that the template that contains the macro is the same template that contains the styles.
Feel free to adopt for your own use, although a reference in the code documentation would be appreciated. Thoughts?