Class Paragraph

  • A Paragraph is a segment of text terminated by a newline character.

  • ThegetIndex() method returns the index of the paragraph's newline.

  • ThegetRange() method returns a TextRange spanning the text in the paragraph.

  • BothgetIndex() andgetRange() require specific authorization scopes.

Paragraph

A segment of text terminated by a newline character.

Methods

MethodReturn typeBrief description
getIndex()Integer|nullReturns the index of the paragraph's newline.
getRange()TextRange|nullReturns aTextRange spanning the text in the paragraph ended by this object's newlinecharacter.

Detailed documentation

getIndex()

Returns the index of the paragraph's newline. Returnsnull if the newline has beendeleted.

Return

Integer|null

Authorization

Scripts that use this method require authorization with one or more of the followingscopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

getRange()

Returns aTextRange spanning the text in the paragraph ended by this object's newlinecharacter. Returnsnull if the paragraph's newline has been deleted.

Return

TextRange|null

Authorization

Scripts that use this method require authorization with one or more of the followingscopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-11 UTC.