If Selection.Type = wpsSelectionNormal Then
If Selection.Font.Hidden = wpsUndefined or _
Selection.Font.Hidden = True Then
MsgBox "There's hidden text in the selection."
Else
MsgBox "No hidden text in the selection."
End If
Else
MsgBox "You need to select some text."
End If
本示例显示活动窗口中的所有隐藏文字并将所选内容的格式设置为隐藏文字。
ActiveDocument.ActiveWindow.View.ShowHiddenText = True
If Selection.Type = wpsSelectionNormal Then _
Selection.Font.Hidden = True