Table of contents
TOC
Collapse the table of content
Expand the table of content

TextRange2.Paragraphs Property (Office)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Gets a TextRange2 object that represents the specified subset of text paragraphs. Read-only.

Syntax

expression. Paragraphs( Start, Length )

expression An expression that returns a TextRange2 object.

Parameters

NameRequired/OptionalData TypeDescription
StartOptionalLongThe first paragraph in the returned range.
LengthOptionalLongThe number of paragraphs to be returned.

Return Value

TextRange2

Remarks

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 PowerPoint presentation.

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

See also

Concepts

TextRange2 Object

Other resources

TextRange2 Object Members

© 2018 Microsoft