Class TextStyleLevel (PowerPoint VBA)

Contains character and paragraph formatting information for an outline level.


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


Returns a Font object that represents character formatting.

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


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


Returns the parent object for the specified object.


Returns the number of objects in the specified collection.

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


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)


Returns the parent object for the specified object.