Font 对象 (PowerPoint)Font object (PowerPoint)

表示文本或项目符号的字符格式。Represents character formatting for text or a bullet. Font对象是**Fonts** 集合的一个成员。The Font object is a member of the Fonts collection. 字体 集合包含在演示文稿中使用的所有字体。The Fonts collection contains all the fonts used in a presentation.

示例Example

以下示例说明如何执行下列操作:The following examples describes how to do the following:

  • 返回font对象, 该对象代表指定的项目符号、指定的文本范围或指定大纲级别的所有文本的字体属性。Return the Font object that represents the font attributes of a specified bullet, a specified range of text, or all text at a specified outline level

  • 从演示文稿中使用的所有字体的集合中返回一个Font对象Return a Font object from the collection of all the fonts used in the presentation

使用font属性返回font对象, 该对象代表特定项目符号、文本范围或大纲级别的字体属性。Use the Fontproperty to return the Font object that represents the font attributes for a specific bullet, text range, or outline level. 下面的示例设置第一张幻灯片的标题文本,并设置字体属性。The following example sets the title text on slide one and sets the font properties.

With ActivePresentation.Slides(1).Shapes.Title _

        .TextFrame.TextRange

    .Text = "Volcano Coffee"

    With .Font

        .Italic = True

        .Name = "Palatino"

        .Color.RGB = RGB(0, 0, 255)

    End With

End With

使用字体(索引), 其中索引是字体的名称或索引号, 返回单个font对象。Use Fonts (index), where index is the font's name or index number, to return a single Font object. 下面的示例检查当前演示文稿中的第一种字体是否已嵌入演示文稿中。The following example checks to see whether font one in the active presentation is embedded in the presentation.

If ActivePresentation.Fonts(1).Embedded = _

    True Then MsgBox "Font 1 is embedded"

属性Properties

名称Name
ApplicationApplication
AutoRotateNumbersAutoRotateNumbers
BaselineOffsetBaselineOffset
BoldBold
ColorColor
可嵌入Embeddable
嵌入Embedded
EmbossEmboss
ItalicItalic
名称Name
NameAsciiNameAscii
NameComplexScriptNameComplexScript
NameFarEastNameFarEast
NameOtherNameOther
ParentParent
ShadowShadow
SizeSize
SubscriptSubscript
SuperscriptSuperscript
UnderlineUnderline

另请参阅See also

PowerPoint 对象模型引用PowerPoint Object Model Reference

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