Skip to main content

ApiTextRange

Class representing a text range within a presentation shape's text frame.

Properties​

NameTypeDescription
EndnumberReturns or sets the end position of the current range.
StartnumberReturns or sets the start position of the current range.

Methods​

The following table lists the available methods.

MethodReturnsDescription
AddHyperlinkApiHyperlink | null | undefinedAdds a hyperlink to the current text range.
AddTextbooleanAdds a text to the specified position. The current range is expanded to include the added text.
DeletebooleanDeletes the contents of the current text range.
ExpandToApiTextRange | nullReturns a new range that spans both this range and the given range. The current range is not changed.
FindApiTextRange | nullFinds the first occurrence of the given text within this range and returns it as a new ApiTextRange. Returns null if the text is not found.
GetAllParagraphsApiParagraph[]Returns all Paragraph objects within this range.
GetClassType"textRange"Returns the class type identifier.
GetEndPosnumberReturns the end position of the current range.
GetParagraphApiParagraph | nullReturns the paragraph at the given index within this range. Returns null if the index is out of bounds.
GetRangeApiTextRange | nullReturns a new ApiTextRange that represents a sub-range of the current range.
GetStartPosnumberReturns the start position of the current range.
GetTextstringReturns the text content of the range. Paragraph breaks are represented as "\r".
GetTextPrApiTextPrReturns the merged text properties of the entire range.
IntersectWithApiTextRange | nullReturns a new range that is the intersection of this range and the given range. The current range is not changed.
MoveCursorToPosbooleanMoves a cursor to the specified position within the current range.
ReplaceApiTextRangeReplaces all occurrences of the specified text within this range.
SelectbooleanSelects the text range in the editor.
SetBoldApiTextRangeSets bold formatting for the contents of the current text range.
SetCapsApiTextRangeSpecifies that any lowercase characters in the current text Range are formatted for display only as their capital letter character equivalents.
SetColorApiTextRangeSets the text color of the current range.
SetDoubleStrikeoutApiTextRangeSpecifies that the contents of the current Range are displayed with two horizontal lines through each character displayed on the line.
SetEndPosbooleanSets the end position of the current range.
SetFontFamilyApiTextRange | nullSets the font family for the current TextRange.
SetFontSizeApiTextRange | nullSets the font size of the characters in the current text Range.
SetHighlightApiTextRange | nullSpecifies a highlighting color which is applied as a background to the contents of the current Range.
SetItalicApiTextRangeSets the italic property to the text character.
SetLanguageApiTextRange | nullSpecifies the language which will be used to check spelling and grammar (if requested) when processing the contents of the current text range.
SetSmallCapsApiTextRangeSpecifies that all the lowercase letter characters in the current text Range are formatted for display only as their capital letter character equivalents which are two points smaller than the actual font size specified for this text.
SetSpacingApiTextRange | nullSets the text spacing measured in twentieths of a point.
SetStartPosbooleanSets the start position of the current range.
SetStrikeoutApiTextRangeSpecifies that the contents of the current Range are displayed with a single horizontal line through the range center.
SetTextApiTextRangeReplaces all text content with the given string. Use "\r" to separate paragraphs.
SetTextPrApiTextRange | nullSets the text properties to the current text range.
SetUnderlineApiTextRangeSpecifies that the contents of the current Range are displayed along with a line appearing directly below the character (less than all the spacing above and below the characters on the line).
SetVertAlignApiTextRange | nullSpecifies the alignment which will be applied to the Range contents in relation to the default appearance of the Range text: "baseline" - the characters in the current text Range will be aligned by the default text baseline. "subscript" - the characters in the current text Range will be aligned below the default text baseline. "superscript" - the characters in the current text Range will be aligned above the default text baseline.
ToHtmlstringConverts the text range to HTML.