Clear unused syles in MS Word with VBA


Clear unused syles in MS Word with VBA

  • Open VBA by press <Alt+F11>
  • Copy the code:
Sub DeleteUnusedStyles()
Dim aStyle As Style
For Each aStyle In ActiveDocument.Styles
If aStyle.BuiltIn = False Then
With ActiveDocument.Content.Find
.ClearFormatting
.Style = aStyle.NameLocal
.Execute FindText:="", Format:=True
If .Found = False Then aStyle.Delete
End With
End If
Next aStyle
End Sub

  • Paste and run...

Nhận xét

Bài đăng phổ biến từ blog này

Danh sach nhom Facebook