Skip to main content

ApiRun

Class representing a small text block called 'run'.

ApiRun is a subclass of ApiTextPr.

Methods​

The following table lists the available methods.

MethodReturnsDescription
AddColumnBreakbooleanAdds a column break to the current run position and starts the next element from a new column.
AddCommentApiComment | null | undefinedAdds a comment to the current run.
AddDrawingbooleanAdds a drawing object (image, shape or chart) to the current text run.
AddHyperlinkApiHyperlink | null | undefinedAdds a hyperlink to the current run.
AddLineBreakbooleanAdds a line break to the current run position and starts the next element from a new line.
AddPageBreakbooleanAdds a page break and starts the next element from a new page.
AddTabStopbooleanAdds a tab stop to the current run.
AddTextbooleanAdds some text to the current run.
ClearContentbooleanClears the content from the current run.
CopyApiRunCreates a copy of the current run.
DeletebooleanDeletes the current run.
GetBoldboolean | null | undefinedGets the bold property from the current text properties.
GetCapsboolean | null | undefinedReturns whether the text with the current text properties are capitalized.
GetClassType"run"Returns a type of the ApiRun class.
GetColorApiColor | null | undefinedGets the RGB color from the current text properties.
GetDoubleStrikeoutboolean | null | undefinedGets the double strikeout property from the current text properties.
GetFontFamilystring | null | undefinedReturns the font family from the current text properties.
GetFontNamesstring[]Returns all font names from all elements inside the current run.
GetFontSizehps | null | undefinedGets the font size from the current text properties.
GetHighlightstring | null | undefinedGets the highlight property from the current text properties.
GetItalicboolean | null | undefinedGets the italic property from the current text properties.
GetLanguagestring | null | undefinedGets the language from the current text properties.
GetOutLineApiStrokeGets the text outline from the current text properties.
GetParentParagraphLikeContainer | null | undefinedReturns the parent element (a paragraph or an inline content control) that directly contains the current run.
GetParentContentControlApiBlockLvlSdt | ApiInlineLvlSdt | nullReturns a content control that contains the current run.
GetParentParagraphApiParagraph | null | undefinedReturns a parent paragraph of the current run.
GetParentTableApiTable | nullReturns a table that contains the current run.
GetParentTableCellApiTableCell | nullReturns a table cell that contains the current run.
GetPosInParentNumberReturns the position (index) of the current run within its parent element.
GetPositionhps | null | undefinedGets the text position from the current text properties measured in half-points (1/144 of an inch).
GetRangeApiRangeReturns a Range object that represents the part of the document contained in the specified run.
GetShdApiShd | undefinedGets the text shading from the current text properties.
GetSmallCapsboolean | null | undefinedReturns whether the text with the current text properties are displayed capitalized two points smaller than the actual font size.
GetSpacingtwips | null | undefinedGets the text spacing from the current text properties measured in twentieths of a point.
GetStrikeoutboolean | null | undefinedGets the strikeout property from the current text properties.
GetStyleApiStyle | null | undefinedGets the style of the current text properties.
GetTextstringReturns a text from the text run.
GetTextFillApiFillGets the text fill from the current text properties.
GetTextPrApiTextPrReturns the text properties of the current run.
GetUnderlineboolean | null | undefinedGets the underline property from the current text properties.
GetVertAlignstring | null | undefinedGets the vertical alignment type from the current text properties.
MoveCursorToPosbooleanMoves a cursor to a specified position of the current text run.
RemoveAllElementsbooleanRemoves all the elements from the current run.
SelectbooleanSelects the current run.
SetBoldApiTextPrSets the bold property to the text character.
SetCapsApiTextPrSpecifies that any lowercase characters in the text run are formatted for display only as their capital letter character equivalents.
SetColorApiTextPrSets the text color to the current text run.
SetDoubleStrikeoutApiTextPrSpecifies that the contents of the run are displayed with two horizontal lines through each character displayed on the line.
SetFontFamilyApiTextPrSets all 4 font slots with the specified font family.
SetFontSizeApiTextPrSets the font size to the characters of the current text run.
SetHighlightApiTextPrSpecifies a highlighting color which is added to the text properties and applied as a background to the contents of the current run/range/paragraph.
SetItalicApiTextPrSets the italic property to the text character.
SetLanguageApiTextPrSpecifies the languages which will be used to check spelling and grammar (if requested) when processing the contents of the text run.
SetOutLineApiTextPrSets the text outline to the current text run.
SetPositionApiTextPrSpecifies an amount by which text is raised or lowered for this run in relation to the default baseline of the surrounding non-positioned text.
SetShdApiTextPrSpecifies the shading applied to the contents of the current text run.
SetSmallCapsApiTextPrSpecifies that all the small letter characters in the text run 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.
SetSpacingApiTextPrSets the text spacing measured in twentieths of a point.
SetStrikeoutApiTextPrSpecifies that the contents of the run are displayed with a single horizontal line through the center of the line.
SetStyleApiTextPrThe text style base method.
SetTextApiRunReplaces the whole text of the current run with the specified text, keeping the run properties.
SetTextFillApiTextPrSets the text fill to the current text run.
SetTextPrApiTextPrSets the text properties to the current run.
SetUnderlineApiTextPrSpecifies that the contents of the run are displayed along with a line appearing directly below the character (less than all the spacing above and below the characters on the line).
SetVertAlignApiTextPrSpecifies the alignment which will be applied to the contents of the run in relation to the default appearance of the run text:
ToJSONJSONConverts the ApiRun object into the JSON object.
WrapInMailMergeFieldbooleanWraps a run in a mail merge field.