选定内容。 Font 属性 (Word)Selection.Font property (Word)

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

语法Syntax

表达式字体expression.Font

_表达式_一个代表**Selection** 对象的变量。expression A variable that represents a Selection object.

说明Remarks

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

示例Example

本示例显示选定文本的字体。This example displays the font of the selected text.

MsgBox Selection.Font.Name

本示例将选定文本的字符格式应用于活动文档的第一段。This example applies the character formatting of the selected text to the first paragraph in the active document.

Set myFont = Selection.Font.Duplicate 
ActiveDocument.Paragraphs(1).Range.Font = myFont

另请参阅See also

Selection 对象Selection Object

支持和反馈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.