Class ParagraphFormat (PowerPoint VBA)

The class ParagraphFormat represents the paragraph formatting of a text range.

Set

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

Dim pft as ParagraphFormat
Set pft = ActiveWindow.Selection.TextRange.ParagraphFormat

The following procedures can be used to set variables of type ParagraphFormat: TextRange.ParagraphFormat and TextStyleLevel.ParagraphFormat

Properties

Alignment returns or sets the alignment for each paragraph in the specified paragraph format.

ActiveWindow.Selection.TextRange.ParagraphFormat.Alignment = ppAlignCenter

BaseLineAlignment returns or sets the base line alignment for the specified paragraph.

ActiveWindow.Selection.TextRange.ParagraphFormat.BaseLineAlignment = ppBaselineAlignAuto

Bullet returns a BulletFormat object that represents bullet formatting for the specified paragraph format.

Dim bftBullet As BulletFormat
Set bftBullet = ActiveWindow.Selection.TextRange.ParagraphFormat.Bullet

FarEastLineBreakControl returns or sets the line break control option if you have an Asian language setting specified.

ActiveWindow.Selection.TextRange.ParagraphFormat.FarEastLineBreakControl = msoTrue

HangingPunctuation returns or sets the hanging punctuation option if you have an Asian language setting specified.

ActiveWindow.Selection.TextRange.ParagraphFormat.HangingPunctuation = msoTrue

LineRuleAfter determines whether line spacing after the last line in each paragraph is set to a specific number of points or lines.

ActiveWindow.Selection.TextRange.ParagraphFormat.LineRuleAfter = msoTrue

LineRuleBefore determines whether line spacing before the first line in each paragraph is set to a specific number of points or lines.

ActiveWindow.Selection.TextRange.ParagraphFormat.LineRuleBefore = msoTrue

LineRuleWithin determines whether line spacing between base lines is set to a specific number of points or lines.

ActiveWindow.Selection.TextRange.ParagraphFormat.LineRuleWithin = msoTrue

Parent returns the parent object for the specified object.

Dim objParent As Object
Set objParent = ActiveWindow.Selection.TextRange.ParagraphFormat.Parent

SpaceAfter returns or sets the amount of space after the last line in each paragraph of the specified text, in points or lines.

ActiveWindow.Selection.TextRange.ParagraphFormat.SpaceAfter = 6

SpaceBefore returns or sets the amount of space before the first line in each paragraph of the specified text, in points or lines.

ActiveWindow.Selection.TextRange.ParagraphFormat.SpaceBefore = 3

SpaceWithin returns or sets the amount of space between base lines in the specified text, in points or lines.

ActiveWindow.Selection.TextRange.ParagraphFormat.SpaceWithin = 2

TextDirection returns or sets the text direction for the specified paragraph.

ActiveWindow.Selection.TextRange.ParagraphFormat.TextDirection = ppDirectionLeftToRight

WordWrap used only with Kanji characters.

ActiveWindow.Selection.TextRange.ParagraphFormat.WordWrap = msoTrue