本示例实现的功能是:检查活动文档中的所有样式,如果检查到一个非内置样式,则显示该样式的名称。

Dim styleLoop As Style
For Each styleLoop in ActiveDocument.Styles
    If styleLoop.BuiltIn = False Then
        Msgbox styleLoop.NameLocal
    End If
Next styleLoop