Format related procedures in class Paragraph (Word VBA)

This page presents procedures from class Paragraph related to the theme Format: AddSpaceBetweenFarEastAndAlpha, AddSpaceBetweenFarEastAndDigit, Borders, DisableLineHeightGrid, Format, HalfWidthPunctuationOnTopOfLine, IndentCharWidth, IndentFirstLineCharWidth, IsStyleSeparator, LineSpacing, LineSpacingRule, Style, Paragraphs.AddSpaceBetweenFarEastAndAlpha, Paragraphs.AddSpaceBetweenFarEastAndDigit, Paragraphs.Borders, Paragraphs.DecreaseSpacing, Paragraphs.DisableLineHeightGrid, Paragraphs.Format, Paragraphs.HalfWidthPunctuationOnTopOfLine, Paragraphs.IncreaseSpacing, Paragraphs.IndentCharWidth, Paragraphs.IndentFirstLineCharWidth, Paragraphs.LineSpacing, Paragraphs.LineSpacingRule and Paragraphs.Style

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.

ActiveDocument.Paragraphs(1).AddSpaceBetweenFarEastAndAlpha = True

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.

ActiveDocument.Paragraphs(1).AddSpaceBetweenFarEastAndDigit = True

Borders

Returns a Borders collection that represents all the borders for the specified paragraph.

For information about returning a single member of a collection, see Returning an object from a collection.

ActiveDocument.Lists(1).ListParagraphs(1).Borders =

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.

With Selection.ParagraphFormat 
 .DisableLineHeightGrid = True 
End With

Format

Returns or sets a ParagraphFormat object that represents the formatting of the specified paragraph or paragraphs.

Set paraFormat = ActiveDocument.Paragraphs(1).Format.Duplicate 
Selection.Paragraphs.Format = paraFormat

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.

ActiveDocument.Paragraphs(1).HalfWidthPunctuationOnTopOfLine = True

IndentCharWidth

Indents a paragraphs by a specified number of characters.

This method is equivalent to clicking the Increase Indent button on the Formatting toolbar.

Syntax : expression.IndentCharWidth (Count)

Count: The number of characters by which the specified paragraphs are to be indented.

With ActiveDocument.Paragraphs(1) 
 .IndentCharWidth 10 
End With

IndentFirstLineCharWidth

Indents the first line of one or more paragraphs by a specified number of characters.

Syntax : expression.IndentFirstLineCharWidth (Count)

Count: The number of characters by which the first line of each specified paragraph is to be indented.

With ActiveDocument.Paragraphs(1) 
 .IndentFirstLineCharWidth 10 
End With

IsStyleSeparator

True if a paragraph contains a special hidden paragraph mark that allows Microsoft Word to appear to join paragraphs of different paragraph styles.

Sub StyleSep() 
 Dim pghDoc As Paragraph 
 For Each pghDoc In ActiveDocument.Paragraphs 
 If pghDoc.IsStyleSeparator = True Then 
 pghDoc.Range.Select 
 Selection.Style = "Normal" 
 End If 
 Next pghDoc 
End Sub

LineSpacing

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

Use the LinesToPoints method to convert a number of lines to the corresponding value in points. For example, LinesToPoints(2) returns the value 24. The LineSpacing property can be set after the LineSpacingRule property has been set to:

With ActiveDocument.Paragraphs(1) 
 .LineSpacingRule = wdLineSpaceAtLeast 
 .LineSpacing = 12 
End With

LineSpacingRule

Returns or sets the line spacing for the specified paragraph.

Possible Values are wdLineSpace1pt5 - Space-and-a-half line spacing. Spacing is equivalent to the current font size plus 6 points, wdLineSpaceAtLeast - Line spacing is always at least a specified amount. The amount is specified separately, wdLineSpaceDouble - Double spaced, wdLineSpaceExactly - Line spacing is only the exact maximum amount of space required. This setting commonly uses less space than single spacing, wdLineSpaceMultiple - Line spacing determined by the number of lines indicated, wdLineSpaceSingle - Single spaced. default.

Use wdLineSpaceSingle, wdLineSpace1pt5, or wdLineSpaceDouble to set the line spacing to one of these values. To set the line spacing to an exact number of points or to a multiple number of lines, you must also set the LineSpacing property.

ActiveDocument.Paragraphs(1).LineSpacingRule = _ 
 wdLineSpaceDouble

Style

Returns or sets the style for the specified style. Read/write Variant.

To set this property, specify the local name of the style, an integer, a WdBuiltinStyle constant, or an object that represents the style.

For Each para in ActiveDocument.Paragraphs 
 MsgBox para.Style 
Next para

Paragraphs.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.

ActiveDocument.Paragraphs(1).AddSpaceBetweenFarEastAndAlpha = True

Paragraphs.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.

ActiveDocument.Paragraphs(1).AddSpaceBetweenFarEastAndDigit = True

Paragraphs.Borders

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

For information about returning a single member of a collection, see Returning an object from a collection.

ActiveDocument.Range.Paragraphs.Borders =

Paragraphs.DecreaseSpacing

Decreases the spacing before and after paragraphs in six-point increments.

Sub DecreaseParaSpacing() 
 Selection.Paragraphs.DecreaseSpacing 
End Sub

Paragraphs.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.

With Selection.ParagraphFormat 
 .DisableLineHeightGrid = True 
End With

Paragraphs.Format

Returns or sets a ParagraphFormat object that represents the formatting of the specified paragraph or paragraphs.

ActiveDocument.Paragraphs.Format.Alignment = wdAlignParagraphLeft

Paragraphs.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.

ActiveDocument.Paragraphs.HalfWidthPunctuationOnTopOfLine = True

Paragraphs.IncreaseSpacing

Increases the spacing before and after paragraphs in six-point increments.

Sub IncreaseParaSpacing() 
 Selection.Paragraphs.IncreaseSpacing 
End Sub

Paragraphs.IndentCharWidth

Indents one or more paragraphs by a specified number of characters.

This method is equivalent to clicking the Increase Indent button on the Formatting toolbar.

Syntax : expression.IndentCharWidth (Count)

Count: The number of characters by which the specified paragraphs are to be indented.

With ActiveDocument.Paragraphs 
 .IndentCharWidth 10 
End With

Paragraphs.IndentFirstLineCharWidth

Indents the first line of one or more paragraphs by a specified number of characters.

Syntax : expression.IndentFirstLineCharWidth (Count)

Count: The number of characters by which the first line of each specified paragraph is to be indented.

With ActiveDocument.Paragraphs 
 .IndentFirstLineCharWidth 10 
End With

Paragraphs.LineSpacing

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

Use the LinesToPoints method to convert a number of lines to the corresponding value in points. For example, LinesToPoints(2) returns the value 24. The LineSpacing property can be set after the LineSpacingRule property has been set to:

With Selection.Paragraphs 
 .LineSpacingRule = wdLineSpaceMultiple 
 .LineSpacing = LinesToPoints(3) 
End With 

Paragraphs.LineSpacingRule

Returns or sets the line spacing for the specified paragraphs.

Possible Values are wdLineSpace1pt5 - Space-and-a-half line spacing. Spacing is equivalent to the current font size plus 6 points, wdLineSpaceAtLeast - Line spacing is always at least a specified amount. The amount is specified separately, wdLineSpaceDouble - Double spaced, wdLineSpaceExactly - Line spacing is only the exact maximum amount of space required. This setting commonly uses less space than single spacing, wdLineSpaceMultiple - Line spacing determined by the number of lines indicated, wdLineSpaceSingle - Single spaced. default.

Use wdLineSpaceSingle, wdLineSpace1pt5, or wdLineSpaceDouble to set the line spacing to one of these values. To set the line spacing to an exact number of points or to a multiple number of lines, you must also set the LineSpacing property.

ActiveDocument.Paragraphs.LineSpacingRule = _ 
 wdLineSpaceDouble

Paragraphs.Style

Returns or sets the style for the specified paragraphs. Read/write Variant.

To set this property, specify the local name of the style, an integer, a WdBuiltinStyle constant, or an object that represents the style. When you return the style for a range that includes more than one style, only the first character or paragraph style is returned.

ActiveDocument.Range.Paragraphs.Style =