Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' Removing Unused Styles by Allen Wyatt (last updated January 15, 2020)
- ' https://word.tips.net/T001337_Removing_Unused_Styles.html
- Sub DeleteUnusedStyles()
- Dim oStyle As Style
- For Each oStyle In ActiveDocument.Styles
- 'Only check out non-built-in styles
- If oStyle.BuiltIn = False Then
- With ActiveDocument.Content.Find
- .ClearFormatting
- .Style = oStyle.NameLocal
- .Execute FindText:="", Format:=True
- If .Found = False Then oStyle.Delete
- End With
- End If
- Next oStyle
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement