AllCaps 属性

       

如果该属性值为 True,则将字体格式设置为全部字母大写。返回 TrueFalse wdUndefined(当返回值既可为 True 也可为 False 时取该值)。该属性可设置为 TrueFalse wdToggle(与当前设置相反)。Long 类型,可读写。

说明

如果设置 AllCaps True,则 SmallCaps 属性的值为 False,反之亦然。

示例

本示例检查活动文档第三段的文本格式是否设置为全部字母大写。

If ActiveDocument.Paragraphs(3).Range.Font.AllCaps = True Then
    MsgBox "Text is all caps."
Else
    MsgBox "Text is not all caps."
End if

本示例将选定文本的字体格式设置为全部字母大写。

If Selection.Type = wdSelectionNormal Then
    Selection.Font.AllCaps = True
Else
    MsgBox "You need to select some text."
End If