Class TextStyleLevel (PowerPoint VBA)

Contains character and paragraph formatting information for an outline level.

Set

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

Dim tsl as TextStyleLevel
Set tsl = ActivePresentation.SlideMaster.TextStyles(1).Levels(Level:=1)

The following procedures can be used to set variables of type TextStyleLevel: TextStyleLevels.Item and TextStyle.Levels

Font

Returns a Font object that represents character formatting.

Dim fntFont As Font
Set fntFont = ActiveWindow.Selection.SlideRange(1).TextStyles(1).Levels(1).Font

ParagraphFormat

Returns a ParagraphFormat object that represents paragraph formatting for the specified text.

Dim pftParagraphFormat As ParagraphFormat
Set pftParagraphFormat = ActiveWindow.Selection.SlideRange(1).TextStyles(1).Levels(1).ParagraphFormat

Parent

Returns the parent object for the specified object.

TextStyleLevels.Count

Returns the number of objects in the specified collection.

Dim lngCount As Long
lngCount = ActiveWindow.Selection.SlideRange(1).TextStyles(1).Levels.Count

TextStyleLevels.Item

Returns a single text style level from the specified TextStyleLevels collection.

Syntax : expression.Item (Level)

Level: The index number of the text style level in the collection to be returned.

Dim tsl As TextStyleLevel
Set tsl = ActivePresentation.SlideMaster.TextStyles(1).Levels(Level:=1)

TextStyleLevels.Parent

Returns the parent object for the specified object.