Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy Styles using Organizer w/o Copying Font

Status
Not open for further replies.

fishey

Instructor
Oct 30, 2002
24
US
Is there a way to write VBA code for Word that will copy a style from one template to another (where the style is based on "Normal") without copying the font of the source's Normal style? In other words, I would like the copied style to be based on the target template's "Normal" rather than the source template's.
 
Hmmm... I can't find any Word VBA methods at all to copy styles between documents or templates. Am I missing something?

Rob
[flowerface]
 
Here is an example of the code I used to copy a style from the FIRM.dot template to the active document:

Dim strThisDocument As String
strThisDocument = ActiveDocument.FullName

With ActiveDocument
.UpdateStylesOnOpen = False
End With

Application.OrganizerCopy Source:= _
"C:\program files\microsoft office\office10\startup\FIRM.dot", _
Destination:=strThisDocument, Name:="Hanging Text 2", _
Object:=wdOrganizerObjectStyles

Selection.Style = ActiveDocument.Styles("Hanging Text 2")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top