Range.Font 属性 (Word)Range.Font property (Word)

返回或设置一个**Font** 对象,代表指定对象的字符格式。Returns or sets a Font object that represents the character formatting of the specified object. Font 类型,可读写。Read/write Font.

语法Syntax

expression.expression. Font

_表达式_代表范围对象的变量。expression A variable that represents a 'Range' object.

备注Remarks

若要设置该属性,指定一个返回**Font** 对象的表达式。To set this property, specify an expression that returns a Font object.

示例Example

本示例将取消活动文档的"标题 1"样式中的加粗格式。This example removes bold formatting from the Heading 1 style in the active document.

ActiveDocument.Styles(wdStyleHeading1).Font.Bold = False

本示例在 Arial 和 Times New Roman 之间切换活动文档中第二段的字体。This example switches the font of the second paragraph in the active document between Arial and Times New Roman.

Set myRange = ActiveDocument.Paragraphs(2).Range 
If myRange.Font.Name = "Times New Roman" Then 
 myRange.Font.Name = "Arial" 
Else 
 myRange.Font.Name = "Times New Roman" 
End If

另请参阅See also

Range 对象Range Object