SmallCaps 属性(Word)Font.SmallCaps property (Word)
如果字体格式为小型大写字母,则该属性值为 True。True if the font is formatted as small capital letters. 读/写 Long。Read/write Long.
语法Syntax
expression。expression. SmallCaps
_表达式_一个返回**Font** 对象的表达式。expression An expression that returns a Font object.
备注Remarks
返回true、 false或wdUndefined ( true和False的混合)。Returns True, False or wdUndefined (a mixture of True and False). 可以设置为 真 、 假 或 wdToggle 。Can be set to True, False, or wdToggle.
如果将SmallCaps属性设置为True ,则**AllCaps** 属性设置为False,反之亦然。Setting the SmallCaps property to True sets the AllCaps property to False, and vice versa.
示例Example
本示例区分新文档中小型大写字母和全部大写字母之间的差别。This example demonstrates the difference between small capital letters and all capital letters in a new document.
Set myRange = Documents.Add.Content
With myRange
.InsertAfter "This is a demonstration of SmallCaps."
.Words(6).Font.SmallCaps = True
.InsertParagraphAfter
.InsertAfter "This is a demonstration of AllCaps."
.Words(14).Font.AllCaps = True
End With
如果部分选定内容中的字体格式已设置为小型大写字母格式,本示例将整个选定内容的字体格式设置为小型大写字母格式。This example formats the entire selection as small capital letters if part of the selection is already formatted as small capital letters.
If Selection.Type = wdSelectionNormal Then
mySel = Selection.Font.SmallCaps
If mySel = wdUndefined Then Selection.Font.SmallCaps = True
Else
MsgBox "You need to select some text."
End If
另请参阅See also
支持和反馈Support and feedback
有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.