TextRange.Paragraphs method (PowerPoint)

Returns a TextRange object that represents the specified subset of text paragraphs.

Syntax

expression. Paragraphs( _Start_, _Length_ )

expression An expression that returns a TextRange object.

Parameters

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

Return value

TextRange

Remarks

For information about counting or looping through the paragraphs in a text range, see the TextRange object.

If both Start and Length are omitted, the returned range starts with the first paragraph and ends with the last paragraph in the specified range.

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

If Length is specified but Start is omitted, the returned range starts with the first paragraph in the specified range.

If Start is greater than the number of paragraphs in the specified text, the returned range starts with the last paragraph in the specified range.

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 italic the first two lines of the second paragraph in shape two on slide one in the active presentation.

Application.ActivePresentation.Slides(1).Shapes(2) _
    .TextFrame.TextRange.Paragraphs(2) _
    .Lines(1, 2).Font.Italic = True

See also

TextRange Object

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.