Class Font (PowerPoint VBA)

The class Font represents character formatting for text or a bullet. The Font object is a member of the Fonts collection. The Fonts collection contains all the fonts used in a presentation.

Set

To use a Font class variable it first needs to be instantiated, for example

Dim fnt as Font
Set fnt = ActivePresentation.Fonts(Index:=1)

The following procedures can be used to set variables of type Font: BulletFormat.Font, Fonts.Item, TextRange.Font, TextStyleLevel.Font and Presentation.Fonts

Methods

Other Methods

Fonts.Replace - Replaces a font in the Fonts collection.

Dim strOriginal As String: strOriginal = 
Dim strReplacement As String: strReplacement = 
ActivePresentation.Fonts.Replace Original:=strOriginal, Replacement:=strReplacement

Properties

AutoRotateNumbers returns or sets lateral compression.

ActivePresentation.Fonts(1).AutoRotateNumbers = msoTrue

BaselineOffset returns or sets the baseline offset for the specified superscript or subscript characters.

ActivePresentation.Fonts(1).BaselineOffset = -0.2

Bold determines whether the character format is bold.

ActivePresentation.Fonts(1).Bold = msoTrue

Color returns or sets the color of the current Font object.

Dim cftColor As ColorFormat
Set cftColor = ActivePresentation.Fonts(1).Color

Embeddable determines whether the specified font can be embedded in the presentation.

Dim mtsEmbeddable As Office.MsoTriState
mtsEmbeddable = ActivePresentation.Fonts(1).Embeddable

Embedded determines whether the specified font is embedded in the presentation.

Dim mtsEmbedded As Office.MsoTriState
mtsEmbedded = ActivePresentation.Fonts(1).Embedded

Emboss determines whether the character format is embossed.

ActivePresentation.Fonts(1).Emboss = msoTrue

Italic true if the font or range is formatted as italic.

ActivePresentation.Fonts(1).Italic = msoTrue

Name returns or sets the name of the specified object.

ActivePresentation.Fonts(1).Name =

NameAscii returns or sets the font used for ASCII characters (characters with character set numbers within the range of 0 to 127).

ActivePresentation.Fonts(1).NameAscii = "Century"

NameComplexScript returns or sets the complex script font name. Used for mixed language text.

ActivePresentation.Fonts(1).NameComplexScript = "Times New Roman"

NameFarEast returns or sets the Asian font name.

Dim strNameFarEast As String
ActivePresentation.Fonts(1).NameFarEast

NameOther returns or sets the font used for characters whose character set numbers are greater than 127.

ActivePresentation.Fonts(1).NameOther = "Tahoma"

Parent returns the parent object for the specified object.

Dim objParent As Object
Set objParent = ActivePresentation.Fonts(1).Parent

Shadow determines whether the specified text has a shadow.

ActivePresentation.Fonts(1).Shadow = msoTrue

Size returns or sets the character size, in points.

ActivePresentation.Fonts(1).Size = 24

Subscript determines whether the specified text is subscript.

ActivePresentation.Fonts(1).Subscript = msoTrue

Superscript determines whether the specified text is superscript.

ActivePresentation.Fonts(1).Superscript = msoTrue

Underline determines whether the specified text (for the Font object) or the font style (for the FontInfo object) is underlined.

ActivePresentation.Fonts(1).Underline = msoTrue

Fonts.Count returns the number of objects in the specified collection.

Dim lngCount As Long
lngCount = ActivePresentation.Fonts.Count

Fonts.Parent returns the parent object for the specified object.

Dim objParent As Object
Set objParent = ActivePresentation.Fonts.Parent