Class ParagraphFormat (Word VBA)

The class ParagraphFormat represents all the formatting for a paragraph.

The main procedures of class ParagraphFormat are OpenOrCloseUp and OpenUp

Set

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

Dim pft as ParagraphFormat
Set pft = Selection.ParagraphFormat

The following procedures can be used to set variables of type ParagraphFormat: ConditionalStyle.ParagraphFormat, Find.ParagraphFormat, Paragraph.Format, Duplicate, Paragraphs.Format, Range.ParagraphFormat, Replacement.ParagraphFormat, Selection.ParagraphFormat and Style.ParagraphFormat

Methods

These are the main methods of the ParagraphFormat class

OpenOrCloseUp - Toggles the spacing before the specified paragraphs.

Selection.ParagraphFormat.OpenOrCloseUp

OpenUp - Sets spacing before the specified paragraphs to 12 points.

Selection.ParagraphFormat.OpenUp

Properties

AddSpaceBetweenFarEastAndAlpha true if Microsoft Word is set to automatically add spaces between Japanese and Latin text for the specified paragraphs. This property returns wdUndefined if it's set to True for only some of the specified paragraphs.

Selection.ParagraphFormat.AddSpaceBetweenFarEastAndAlpha =

AddSpaceBetweenFarEastAndDigit true if Microsoft Word is set to automatically add spaces between Japanese text and numbers for the specified paragraphs. This property returns wdUndefined if it's set to True for only some of the specified paragraphs.

Selection.ParagraphFormat.AddSpaceBetweenFarEastAndDigit =

Alignment returns or sets a WdParagraphAlignment constant that represents the alignment for the specified paragraphs.

Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter

AutoAdjustRightIndent true if Microsoft Word is set to automatically adjust the right indent for the specified paragraphs if you've specified a set number of characters per line. Returns wdUndefined if the AutoAdjustRightIndent property is set to True for only some of the specified paragraphs.

Selection.ParagraphFormat.AutoAdjustRightIndent =

BaseLineAlignment returns or sets a WdBaselineAlignment constant that represents the vertical position of fonts on a line.

Selection.ParagraphFormat.BaseLineAlignment = wdBaselineAlignAuto

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

Selection.ParagraphFormat.Borders =

CharacterUnitFirstLineIndent returns or sets the value (in characters) for a first-line or hanging indent. Use a positive value to set a first-line indent, and use a negative value to set a hanging indent.

Selection.ParagraphFormat.CharacterUnitFirstLineIndent =

CharacterUnitLeftIndent returns or sets the left indent value (in characters) for the specified paragraphs.

Selection.ParagraphFormat.CharacterUnitLeftIndent =

CharacterUnitRightIndent returns or sets the right indent value (in characters) for the specified paragraphs.

Selection.ParagraphFormat.CharacterUnitRightIndent =

CollapsedByDefault returns or sets whether the specified paragraph format is collapsed by default.

Selection.ParagraphFormat.CollapsedByDefault =

DisableLineHeightGrid true if Microsoft Word aligns characters in the specified paragraphs to the line grid when a set number of lines per page is specified. Returns wdUndefined if the DisableLineHeightGrid property is set to True for only some of the specified paragraphs.

Selection.ParagraphFormat.DisableLineHeightGrid =

Duplicate returns a read-only ParagraphFormat object that represents the paragraph formatting of the specified paragraph.

Dim pftDuplicate As ParagraphFormat
Set pftDuplicate = Selection.ParagraphFormat.Duplicate

FarEastLineBreakControl true if Microsoft Word applies East Asian line-breaking rules to the specified paragraphs. Returns wdUndefined if the FarEastLineBreakControl property is set to True for only some of the specified paragraphs.

Selection.ParagraphFormat.FarEastLineBreakControl =

FirstLineIndent returns or sets the value (in points) for a first line or hanging indent. Use a positive value to set a first-line indent, and use a negative value to set a hanging indent.

Selection.ParagraphFormat.FirstLineIndent =

HalfWidthPunctuationOnTopOfLine true if Microsoft Word changes punctuation symbols at the beginning of a line to half-width characters for the specified paragraphs. This property returns wdUndefined if it's set to True for only some of the specified paragraphs.

Selection.ParagraphFormat.HalfWidthPunctuationOnTopOfLine =

HangingPunctuation true if hanging punctuation is enabled for the specified paragraphs. This property returns wdUndefined if it's set to True for only some of the specified paragraphs.

Selection.ParagraphFormat.HangingPunctuation =

Hyphenation true if the specified paragraphs are included in automatic hyphenation. False if the specified paragraphs are to be excluded from automatic hyphenation.

Selection.ParagraphFormat.Hyphenation =

KeepTogether true if all lines in the specified paragraphs remain on the same page when Microsoft Word repaginates the document.

Selection.ParagraphFormat.KeepTogether =

KeepWithNext true if the specified paragraph remains on the same page as the paragraph that follows it when Microsoft Word repaginates the document.

Selection.ParagraphFormat.KeepWithNext =

LeftIndent returns or sets a Single that represents the left indent value (in points) for the specified paragraph formatting.

Selection.ParagraphFormat.LeftIndent =

LineSpacing returns or sets the line spacing (in points) for the specified paragraphs.

Selection.ParagraphFormat.LineSpacing =

LineSpacingRule returns or sets the line spacing for the specified paragraph formatting.

Selection.ParagraphFormat.LineSpacingRule = wdLineSpace1pt5

LineUnitAfter returns or sets the amount of spacing (in gridlines) after the specified paragraphs.

Selection.ParagraphFormat.LineUnitAfter =

LineUnitBefore returns or sets the amount of spacing (in gridlines) before the specified paragraphs.

Selection.ParagraphFormat.LineUnitBefore =

MirrorIndents returns or sets a Long that represents whether left and right indents are the same width. Can be True, False, or wdUndefined.

Selection.ParagraphFormat.MirrorIndents =

NoLineNumber true if line numbers are repressed for the specified paragraphs. Can be True, False, or wdUndefined.

Selection.ParagraphFormat.NoLineNumber =

OutlineLevel returns or sets the outline level for the specified paragraphs.

Selection.ParagraphFormat.OutlineLevel = wdOutlineLevel1

PageBreakBefore true if a page break is forced before the specified paragraphs. Can be True, False, or wdUndefined.

Selection.ParagraphFormat.PageBreakBefore =

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

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

ReadingOrder returns or sets the reading order of the specified paragraphs without changing their alignment.

Selection.ParagraphFormat.ReadingOrder = wdReadingOrderLtr

RightIndent returns or sets the right indent (in points) for the specified paragraphs.

Selection.ParagraphFormat.RightIndent =

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

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

SpaceAfter returns or sets the amount of spacing (in points) after the specified paragraph or text column.

Selection.ParagraphFormat.SpaceAfter =

SpaceAfterAuto true if Microsoft Word automatically sets the amount of spacing after the specified paragraphs.

Selection.ParagraphFormat.SpaceAfterAuto =

SpaceBefore returns or sets the spacing (in points) before the specified paragraphs.

Selection.ParagraphFormat.SpaceBefore =

SpaceBeforeAuto true if Microsoft Word automatically sets the amount of spacing before the specified paragraphs.

Selection.ParagraphFormat.SpaceBeforeAuto =

Style returns or sets the style for the specified style. Read/write Variant.

Selection.ParagraphFormat.Style =

TabStops returns or sets a TabStops collection that represents all the custom tab stops for the specified paragraphs.

Selection.ParagraphFormat.TabStops =

TextboxTightWrap returns or sets a WdTextboxTightWrap constant that represents how tightly text wraps around shapes or text boxes.

Selection.ParagraphFormat.TextboxTightWrap = wdTightAll

WidowControl true if the first and last lines in the specified paragraph remain on the same page as the rest of the paragraph when Word repaginates the document. Can be True, False or wdUndefined.

Selection.ParagraphFormat.WidowControl =

WordWrap true if Microsoft Word wraps Latin text in the middle of a word in the specified paragraphs or text frames.

Selection.ParagraphFormat.WordWrap =