如果部分选定内容中的字体格式已设置为小型大写字母格式,本示例将整个选定内容的字体格式设置为小型大写字母格式。

If Selection.Type = wpsSelectionNormal Then
    mySel = Selection.Font.SmallCaps
    If mySel = wpsUndefined Then Selection.Font.SmallCaps = True
Else
    MsgBox "You need to select some text."
End If