TextRange.Paragraphs method (Publisher)

Returns a TextRange object that represents the specified paragraphs.

Syntax

expression.Paragraphs (Start, Length)

expression A variable that represents a TextRange object.

Parameters

Name Required/Optional Data type Description
Start Required Long The first paragraph in the returned range.
Length Optional Long The number of paragraphs to be returned. The default is 1.

Return value

TextRange

Remarks

If Length is omitted, the returned range contains one paragraph.

If Length is greater than the number of paragraphs from the specified starting paragraph to the end of the text, the returned range contains all those paragraphs.

Example

This example formats as indents the first line of the selected paragraph.

Sub FormatCurrentParagraph() 
 Selection.TextRange.Paragraphs(Start:=1).ParagraphFormat _ 
 .FirstLineIndent = InchesToPoints(0.5) 
End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.