J
Jose Valdes
This script is supposed print a list of paragraph styles that are currently
used in the document. Unfortunately, it fails to capture paragraph styles
that are used in headers and footers. Can anyone suggest ways of expanding
the scope to capture header/footer content? Thanks! Jose
Sub DisplayStylesInUse()
Dim para As Paragraph
Dim sty As Style
Dim StirPara As String
Dim AllStyles As String
Dim ResultOfCompare As Long
AllStyles = "Normal"
For Each para In ActiveDocument.Paragraphs
StirPara = para.Style.NameLocal
ResultOfCompare = InStr(1, AllStyles, StirPara, 1)
If ResultOfCompare = False Then
AllStyles = AllStyles & "| " & StirPara
End If
Next para
Selection.EndKey Unit:=wdStory
Selection.TypeText Text:=AllStyles
End Sub
used in the document. Unfortunately, it fails to capture paragraph styles
that are used in headers and footers. Can anyone suggest ways of expanding
the scope to capture header/footer content? Thanks! Jose
Sub DisplayStylesInUse()
Dim para As Paragraph
Dim sty As Style
Dim StirPara As String
Dim AllStyles As String
Dim ResultOfCompare As Long
AllStyles = "Normal"
For Each para In ActiveDocument.Paragraphs
StirPara = para.Style.NameLocal
ResultOfCompare = InStr(1, AllStyles, StirPara, 1)
If ResultOfCompare = False Then
AllStyles = AllStyles & "| " & StirPara
End If
Next para
Selection.EndKey Unit:=wdStory
Selection.TypeText Text:=AllStyles
End Sub