Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Dim myPara As Paragraph
Dim myStory As Range
Dim myCollection As Collection
Set myCollection = New Collection
For Each myStory In ActiveDocument.StoryRanges
For Each myPara In myStory.Paragraphs
On Error Resume Next
myCollection.Add myPara.Style.NameLocal
On Error GoTo 0
Next
Next
[COLOR=green]' At this point myCollection contains list of styles in use by document
[/color]
Sub liststyles()
Dim sty As Style
For Each sty In ActiveDocument.Styles
Selection.TypeText sty.NameLocal & vbCrLf
Next
End Sub
[blue]Set mydoc = ActiveDocument
msg = "Styles in use:" & vbCr
For Each sty In mydoc.Styles
If sty.InUse = True Then
With mydoc.Content.find
.ClearFormatting
.Text = ""
.Style = sty
.Execute Format:=True
If .Found = True Then
msg = msg & sty & vbCr
End If
End With
End If
Next sty
MsgBox msg[/blue]
Dim myStory As Range
Dim myCollection As Collection
Dim myCharInfo As Range
Set myCollection = New Collection
For Each myStory In ActiveDocument.StoryRanges
For Each myCharInfo In myStory.Characters
On Error Resume Next
myCollection.Add myCharInfo.Style.NameLocal, myCharInfo.Style.NameLocal
On Error GoTo 0
Next
Next
[COLOR=green]' At this point myCollection contains list of styles in use by document
[/color]