Class Font (Word VBA)

Contains font attributes (such as font name, font size and color) for an object.

Set

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

Dim fnt as Font
Set fnt = Selection.Font

The following procedures can be used to set variables of type Font: ConditionalStyle.Font, Find.Font, Duplicate, ListLevel.Font, Range.Font, Replacement.Font, Selection.Font and Style.Font

Properties

AllCaps true if the font is formatted as all capital letters.

Selection.Font.AllCaps =

Bold true if the font is formatted as bold.

Selection.Font.Bold =

BoldBi true if the font is formatted as bold.

Selection.Font.BoldBi =

Borders returns a Borders collection that represents all the borders for the specified font.

Selection.Font.Borders =

ColorIndex returns or sets a WdColorIndex constant that represents the color for the specified font.

Selection.Font.ColorIndex = wdAuto

ColorIndexBi returns or sets the color for the specified Font object in a right-to-left language document.

Selection.Font.ColorIndexBi = wdAuto

ContextualAlternates specifies whether or not contextual alternates are enabled for the specified font.

Selection.Font.ContextualAlternates =

DiacriticColor returns or sets the 24-bit color to be used for diacritics for the specified Font object.

Selection.Font.DiacriticColor = RGB(0,0,255)'blue

DisableCharacterSpaceGrid true if Microsoft Word ignores the number of characters per line for the corresponding Font object.

Selection.Font.DisableCharacterSpaceGrid = True

DoubleStrikeThrough true if the specified font is formatted as double strikethrough text.

Selection.Font.DoubleStrikeThrough =

Duplicate returns a copy of a Font object that represents the character formatting of the specified font.

Dim fntDuplicate As Font
Set fntDuplicate = Selection.Font.Duplicate

Emboss true if the specified font is formatted as embossed.

Selection.Font.Emboss =

EmphasisMark returns or sets a WdEmphasisMark constant that represents the emphasis mark for a character or designated character string.

Selection.Font.EmphasisMark = wdEmphasisMarkNone

Engrave true if the font is formatted as engraved.

Selection.Font.Engrave =

Fill returns a FillFormat object that contains fill formatting properties for the font used by the specified range of text.

Selection.Font.Fill =

Glow returns a GlowFormat object that represents the glow formatting for the font used by the specified range of text.

Selection.Font.Glow =

Hidden true if the font is formatted as hidden text.

Selection.Font.Hidden =

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

Selection.Font.Italic =

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

Selection.Font.ItalicBi =

Kerning returns or sets the minimum font size for which Microsoft Word will adjust kerning automatically.

Selection.Font.Kerning =

Ligatures returns or sets the ligatures setting for the specified Font object.

Selection.Font.Ligatures = wdLigaturesAll

Line returns a LineFormat object that specifies the formatting for a line.

Selection.Font.Line =

Name returns or sets the name of the specified object.

Selection.Font.Name =

NameAscii returns or sets the font used for Latin text (characters with character codes from 0 (zero) through 127).

Selection.Font.NameAscii =

NameBi returns or sets the name of the font in a right-to-left language document.

Selection.Font.NameBi =

NameFarEast returns or sets an East Asian font name.

Selection.Font.NameFarEast =

NameOther returns or sets the font used for characters with character codes from 128 through 255.

Selection.Font.NameOther =

NumberForm returns or sets the number form setting for an OpenType font.

Selection.Font.NumberForm = wdNumberFormDefault

NumberSpacing returns or sets the number spacing setting for a font.

Selection.Font.NumberSpacing = wdNumberSpacingDefault

Outline true if the font is formatted as outline.

Selection.Font.Outline =

Parent returns an object that represents the parent object of the specified Font object.

Dim objParent As Object
Set objParent = Selection.Font.Parent

Position returns or sets the position of text (in points) relative to the base line.

Selection.Font.Position =

Reflection returns a ReflectionFormat object that represents the reflection formatting for a shape.

Selection.Font.Reflection =

Scaling returns or sets the scaling percentage applied to the font.

Selection.Font.Scaling =

Shading returns a Shading object that refers to the shading formatting for the specified font.

Dim shdShading As Shading
Set shdShading = Selection.Font.Shading

Shadow true if the specified font is formatted as shadowed.

Selection.Font.Shadow =

Size returns or sets the font size, in points.

Selection.Font.Size =

SizeBi returns or sets the font size in points.

Selection.Font.SizeBi =

SmallCaps true if the font is formatted as small capital letters.

Selection.Font.SmallCaps =

Spacing returns or sets the spacing (in points) between characters.

Selection.Font.Spacing =

StrikeThrough true if the font is formatted as strikethrough text.

Selection.Font.StrikeThrough =

StylisticSet specifies the stylistic set for the specified font.

Selection.Font.StylisticSet = wdStylisticSet01

Subscript true if the font is formatted as subscript.

Selection.Font.Subscript =

Superscript true if the font is formatted as superscript.

Selection.Font.Superscript =

TextColor returns a ColorFormat object that represents the color for the specified font.

Dim cftTextColor As ColorFormat
Set cftTextColor = Selection.Font.TextColor

TextShadow returns a ShadowFormat object that specifies the shadow formatting for the specified font.

Selection.Font.TextShadow =

ThreeD returns a ThreeDFormat object that contains 3D effect formatting properties for the specified font.

Selection.Font.ThreeD =

Underline returns or sets the type of underline applied to the font.

Selection.Font.Underline = wdUnderlineDash

UnderlineColor returns or sets the 24-bit color of the underline for the specified Font object.

Selection.Font.UnderlineColor = RGB(0,0,255)'blue