Skip to main content

ApiParagraph

Class representing a paragraph.

ApiParagraph is a subclass of ApiParaPr.

Methods​

The following table lists the available methods.

MethodReturnsDescription
AddElementbooleanAdds an element to the current paragraph.
AddLineBreakApiRunAdds a line break to the current position and starts the next element from a new line.
AddTabStopApiRunAdds a tab stop to the current paragraph.
AddTextApiRunAdds some text to the current paragraph.
CopyApiParagraphCreates a paragraph copy.
DeletebooleanDeletes the current paragraph.
GetClassType"paragraph"Returns a type of the ApiParagraph class.
GetElementParagraphContentReturns a paragraph element using the position specified.
GetElementsCountnumberReturns a number of elements in the current paragraph.
GetFontNamesstring[]Returns all font names from all elements inside the current paragraph.
GetIndFirstLinetwips | undefinedReturns the paragraph first line indentation.
GetIndLefttwips | undefinedReturns the paragraph left side indentation.
GetIndRighttwips | undefinedReturns the paragraph right side indentation.
GetInternalIdstringReturns an internal ID of the current content paragraph.
GetJc"left" | "right" | "both" | "center" | undefinedReturns the paragraph contents justification.
GetLastRunWithTextApiRunReturns the last Run with text in the current paragraph.
GetNextApiParagraph | nullReturns the next paragraph.
GetOutlineLvlNumber | undefinedReturns the outline level of the specified properties.
GetParaPrApiParaPrReturns the paragraph properties.
GetPreviousApiParagraphReturns the previous paragraph.
GetSpacingAftertwipsReturns the spacing after value of the current paragraph.
GetSpacingBeforetwipsReturns the spacing before value of the current paragraph.
GetSpacingLineRule"auto" | "atLeast" | "exact" | undefinedReturns the paragraph line spacing rule.
GetSpacingLineValuetwips | line240 | undefinedReturns the paragraph line spacing value.
GetTabsTabStop[]Returns the custom tab stops of the current paragraph.
GetTextstringReturns the paragraph text.
InsertParagraphApiParagraph | nullInserts a paragraph at the specified position.
LastParagraphContentReturns the last element of the paragraph.
MoveCursorToEndbooleanMoves the cursor to the end of the paragraph.
MoveCursorToStartbooleanMoves the cursor to the start of the paragraph.
PushbooleanAdds an element to the current paragraph.
RemoveAllElementsbooleanRemoves all the elements from the current paragraph.
RemoveElementbooleanRemoves an element using the position specified.
SetBoldApiParagraphSets the bold property to the text character.
SetBulletNoneSets the bullet or numbering to the current paragraph.
SetCapsApiParagraphSpecifies that any lowercase characters in this paragraph are formatted for display only as their capital letter character equivalents.
SetColorApiParagraphSets the text color to the current paragraph.
SetDoubleStrikeoutApiParagraphSpecifies that the contents of this paragraph are displayed with two horizontal lines through each character displayed on the line.
SetFontFamilyApiParagraphSets all 4 font slots with the specified font family.
SetFontSizeApiParagraphSets the font size to the characters of the current paragraph.
SetIndFirstLinebooleanSets the paragraph first line indentation.
SetIndLeftbooleanSets the paragraph left side indentation.
SetIndRightbooleanSets the paragraph right side indentation.
SetItalicApiParagraphSets the italic property to the text character.
SetJcbooleanSets the paragraph contents justification.
SetOutlineLvlbooleanSets the outline level for the specified properties.
SetSmallCapsApiParagraphSpecifies that all the small letter characters in this paragraph 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.
SetSpacingApiParagraphSets the text spacing measured in twentieths of a point.
SetSpacingAfterbooleanSets the spacing after the current paragraph.
SetSpacingBeforebooleanSets the spacing before the current paragraph.
SetSpacingLinebooleanSets the paragraph line spacing.
SetStrikeoutApiParagraphSpecifies that the contents of this paragraph are displayed with a single horizontal line through the center of the line.
SetTabsbooleanSpecifies a sequence of custom tab stops which will be used for any tab characters in the current paragraph.
SetTextApiRunReplaces the paragraph content with the specified text.
SetTextPrbooleanSets the paragraph text properties.
SetUnderlineApiParagraphSpecifies that the contents of this paragraph are displayed along with a line appearing directly below the character (less than all the spacing above and below the characters on the line).
ToJSONJSONConverts the ApiParagraph object into the JSON object.