View Single Post
  #3   Report Post  
Andy
 
Posts: n/a
Default

I got this from an issue of Editorium Update.

Use at your own risk.


================================================== =



Sub DeleteUnusedStyles()
'Courtesy of the Editorium
'www.editorium.com
Dim sty As Style
For Each sty In ActiveDocument.Styles
If sty.BuiltIn = False Then
If sty.InUse = False Then
sty.Delete
Else
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles(sty)
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
If Selection.Find.Found = False Then sty.Delete
End If
End If
Next sty
Selection.HomeKey Unit:=wdStory
End Sub