RE: Style Comparison

Subject: RE: Style Comparison
From: "Steve Hudson" <steve -at- wright -dot- com -dot- au>
To: "TECHWR-L" <techwr-l -at- lists -dot- raycomm -dot- com>
Date: Fri, 5 Oct 2001 10:10:07 +1000

Indeed we were just discussing that the other day onlist

I used these two macros to generate my output to the list. Do this for each
set of styles and then use Compare Documents to generate the list of

Of course you will have to edit the content of GimmeStyleNames but that
should be a doddle

Sub StyleLister()
Dim StyleCounter As Integer, k As Integer
Dim InDoc As Word.Document, OutDoc As Word.Document
Dim s As Word.Style
Dim myStyles() As String
Dim Flag As Boolean

GimmeStyleNames myStyles()
Set InDoc = ActiveDocument
Set OutDoc = Documents.Add
With OutDoc.Range
'changing stylesets (internal) clipped
For StyleCounter = 1 To InDoc.Styles.Count
Set s = InDoc.Styles(StyleCounter)
Flag = False
For k = 1 To UBound(myStyles) 'my style or built-in?
If s.NameLocal = myStyles(k) Then
Flag = True
Exit For
End If
If Flag Then
.InsertAfter s.NameLocal & vbTab & s.Description
End If
End With
End Sub

Sub GimmeStyleNames(AnArray() As String)
ReDim AnArray(46) As String

AnArray(1) = "Normal"
AnArray(2) = "Default Paragraph Font"
AnArray(3) = "Body Text"
AnArray(4) = "Body Text C"
AnArray(5) = "Body Text R"
AnArray(6) = "Code"
AnArray(7) = "Copyright"
AnArray(8) = "Emphasis"
AnArray(9) = "FollowedHyperlink"
AnArray(10) = "Footer"
AnArray(11) = "Glossary"
AnArray(12) = "Header"
AnArray(13) = "Heading 1"
AnArray(14) = "Heading 2"
AnArray(15) = "Heading 3"
AnArray(16) = "Heading 4"
AnArray(17) = "Heading 5"
AnArray(18) = "Heading 6"
AnArray(19) = "Heading 7"
AnArray(20) = "Heading 8"
AnArray(21) = "Heading 9"
AnArray(22) = "Heading 1 No TOC"
AnArray(23) = "Heading 2 No TOC"
AnArray(24) = "Heading-table-centred"
AnArray(25) = "Heading-table-left"
AnArray(26) = "Heading-table-right"
AnArray(27) = "Hyperlink"
AnArray(28) = "Input"
AnArray(29) = "KeyPress"
AnArray(30) = "List Bullet"
AnArray(31) = "List Number"
AnArray(32) = "List Number Outline"
AnArray(33) = "Output"
AnArray(34) = "Page Number"
AnArray(35) = "Subtitle"
AnArray(36) = "Terminal Screen"
AnArray(37) = "TextBox"
AnArray(38) = "TextBox C"
AnArray(39) = "TextBox R"
AnArray(40) = "Title"
AnArray(41) = "TOC 1"
AnArray(42) = "TOC 2"
AnArray(43) = "TOC 3"
AnArray(44) = "TOC 4"
AnArray(45) = "Version"
AnArray(46) = "Generic"
End Sub

Steve Hudson
Principal Technical Writer
Wright Technologies (Aus)
steve -at- wright -dot- com -dot- au
(612) 9518-1822
The best way to predict the future... is to create it!

-----Original Message-----
From: Patti Arteaga

I've seen a couple of notes going back and forth regarding comparing styles.
We've just instituted a new style for all of our documents and I was in the
process of changing them over. Our Director of Engineering decided to
modify our new styles and now I need to compare the styles. Is there a
simple way (I've never used VBA) to print out and compare each style in two
different documents?

Patti Arteaga


Planning to attend IPCC 01, October 24-27 in Santa Fe? Sign up by
October 3 and get a substantial discount! Program information,
online registration, and more on

Your monthly sponsorship message here reaches more than
5000 technical writers, providing 2,500,000+ monthly impressions.
Contact Eric (ejray -at- raycomm -dot- com) for details and availability.

You are currently subscribed to techwr-l as: archive -at- raycomm -dot- com
To unsubscribe send a blank email to leave-techwr-l-obscured -at- lists -dot- raycomm -dot- com
Send administrative questions to ejray -at- raycomm -dot- com -dot- Visit for more resources and info.

Previous by Author: RE: User Documentation in XP environment (Possible Process)
Next by Author: RE: List Numbering Problem
Previous by Thread: re: Printing multiple HTML pages at once
Next by Thread: RE: Display or appear (Was: Can "either" be used if there are thr ee or moreselections?)

What this post helpful? Share it with friends and colleagues:

Sponsored Ads