TextRange2.Sentences property (Office)

Returns a TextRange2 object that represents the specified subset of text sentences. Read-only.

Syntax

expression.Sentences (Start, Length)

expression An expression that returns a TextRange2 object.

Parameters

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

Return value

TextRange2

Remarks

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

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

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

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

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

Example

This example formats as bold the second sentence in the second paragraph in shape two on slide one in the active PowerPoint presentation.

Application.ActivePresentation.Slides(1).Shapes(2) _ 
 .TextFrame.TextRange2.Paragraphs(2).Sentences(2).Font _ 
 .Bold = True 
 

See also

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.