Class ChartFont (PowerPoint VBA)

Contains the font attributes (font name, font size, color, and so on) for an object chart.


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

Dim cft as ChartFont
Set cft = ActiveWindow.RangeFromPoint.Chart.DataTable.Font

The following procedures can be used to set variables of type ChartFont: ChartCharacters.Font, DataTable.Font, LegendEntry.Font and TickLabels.Font


The following procedures in this class have been grouped together and are described on a separate theme page

Format with its procedures Color, ColorIndex and FontStyle


Background returns or sets the type of background for text used in charts. Read/write Variant that is set to one of the constants of XlBackground.

ActivePresentation.Slides(1).Shapes(1).Chart.DataTable.Font.Background = xlBackgroundAutomatic

Bold true if the font is bold.

ActivePresentation.Slides(1).Shapes(1).Chart.DataTable.Font.Bold = True

Italic true if the font style is italic. Read/write Boolean.

ActivePresentation.Slides(1).Shapes(1).Chart.DataTable.Font.Italic = True

Name returns or sets the name of the string. Read/write String.

ActiveWindow.RangeFromPoint.Chart.DataTable.Font.Name =

Parent returns the parent for the specified object. Read-only object.

Dim objParent As Object
Set objParent = ActiveWindow.RangeFromPoint.Chart.DataTable.Font.Parent

Size returns or sets the size of the font.

ActivePresentation.Slides(1).Shapes(1).Chart.DataTable.Font.Size = 12

Strikethrough true if the font is struck through with a horizontal line. Read/write Boolean.

ActiveWindow.RangeFromPoint.Chart.DataTable.Font.Strikethrough = True

Subscript true if the font is formatted as subscript. The default is False.

ActiveWindow.RangeFromPoint.Chart.DataTable.Font.Subscript = True

Superscript true if the font is formatted as superscript. The default is False.

ActiveWindow.RangeFromPoint.Chart.DataTable.Font.Superscript = True

Underline returns or sets the type of underline applied to the font. Can be one of the XlUnderlineStyle constants. Read/write Variant.

ActivePresentation.Slides(1).Shapes(1).Chart.DataTable.Font.Underline = xlUnderlineStyleDouble