Skip to main content

ApiParagraph

Represents the ApiParagraph class.

Methods

MethodReturnsDescription
AddBookmarkCrossRefbooleanAdds a bookmark cross-reference to the current paragraph.\ 💡 Please note that this paragraph must be in the document.
AddCaptionbooleanAdds a caption paragraph after (or before) the current paragraph.\ 💡 Please note that the current paragraph must be in the document (not in the footer/header).\ And if the current paragraph is placed in a shape, then a caption is added after (or before) the parent shape.
AddCaptionCrossRefbooleanAdds a caption cross-reference to the current paragraph.\ 💡 Please note that this paragraph must be in the document.
AddColumnBreakApiRunAdds a column break to the current position and starts the next element from a new column.
AddCommentApiCommentAdds a comment to the current paragraph.\ 💡 Please note that this paragraph must be in the document.
AddDrawingApiRunAdds a drawing object (image, shape or chart) to the current paragraph.
AddElementbooleanAdds an element to the current paragraph.
AddEndnoteCrossRefbooleanAdds an endnote cross-reference to the current paragraph.\ 💡 Please note that this paragraph must be in the document.
AddFootnoteCrossRefbooleanAdds a footnote cross-reference to the current paragraph.\ 💡 Please note that this paragraph must be in the document.
AddHeadingCrossRefbooleanAdds a heading cross-reference to the current paragraph.\ 💡 Please note that this paragraph must be in the document.
AddHyperlinkApiHyperlink | nullAdds a hyperlink to a paragraph.
AddInlineLvlSdtApiInlineLvlSdtAdds an inline container.
AddLineBreakApiRunAdds a line break to the current position and starts the next element from a new line.
AddNumberedCrossRefbooleanAdds a numbered cross-reference to the current paragraph.\ 💡 Please note that this paragraph must be in the document.
AddPageBreakApiRunAdds a page break and starts the next element from the next page.
AddPageNumberApiRunInserts a number of the current document page into the paragraph.
AddPagesCountApiRunInserts a number of pages in the current document into the paragraph.
AddTabStopApiRunAdds a tab stop to the current paragraph.
AddTextApiRunAdds some text to the current paragraph.
CopyApiParagraphCreates a paragraph copy. Ingnore comments, footnote references, complex fields.
DeletebooleanDeletes the current paragraph.
GetAllChartsApiChart[]Returns a collection of chart objects in the paragraph.
GetAllContentControlsApiInlineLvlSdt[]Returns a collection of content control objects in the paragraph.
GetAllDrawingObjectsDrawing[]Returns a collection of drawing objects in the paragraph.
GetAllImagesApiImage[]Returns a collection of image objects in the paragraph.
GetAllOleObjectsApiOleObject[]Returns a collection of OLE objects in the paragraph.
GetAllShapesApiShape[]Returns a collection of shape objects in the paragraph.
GetClassType"paragraph"Returns a type of the ApiParagraph class.
GetClassType"paraPr"Returns a type of the ApiParaPr 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.
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.
GetNumberingApiNumberingLevelReturns the numbering definition and numbering level for the numbered list.
GetOutlineLvlNumberReturns the outline level of the specified properties.
GetParaPrApiParaPrReturns the paragraph properties.
GetParagraphMarkTextPrApiTextPrReturns the text properties of the paragraph mark which is used to mark the paragraph end. The mark can also acquire\ common text properties like bold, italic, underline, etc.
GetParentContentControlApiBlockLvlSdt | nullReturns a content control that contains the current paragraph.
GetParentTableApiTable | nullReturns a table that contains the current paragraph.
GetParentTableCellApiTableCell | nullReturns a table cell that contains the current paragraph.
GetPosInParentNumberReturns the paragraph position within its parent element.
GetPreviousApiParagraphReturns the previous paragraph.
GetRangeApiRangeReturns a Range object that represents the part of the document contained in the specified paragraph.
GetSectionApiSectionReturns the paragraph section.
GetShdApiRGBColorReturns the shading applied to the contents of the 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.
GetStyleApiStyleReturns the paragraph style method.
GetTextstringReturns the paragraph text.
GetTextPrApiTextPrReturns the paragraph text properties.
InsertInContentControlApiParagraph | ApiBlockLvlSdtWraps the paragraph object with a rich text content control.
InsertParagraphApiParagraph | nullInserts a paragraph at the specified position.
LastParagraphContentReturns the last element of the paragraph which is not empty.
PushbooleanAdds an element to the current paragraph.
RemoveAllElementsNoneRemoves all the elements from the current paragraph.\ 💡 When all the elements are removed from the paragraph, a new empty run is automatically created. If you want to add\ content to this run, use the ApiParagraph#GetElement method.
RemoveElementNoneRemoves an element using the position specified.\ 💡 If the element you remove is the last paragraph element (i.e. all the elements are removed from the paragraph),\ a new empty run is automatically created. If you want to add\ content to this run, use the ApiParagraph#GetElement method.
ReplaceByElementbooleanReplaces the current paragraph with a new element.
SearchApiRange[]Searches for a scope of a paragraph object. The search results are a collection of ApiRange objects.
SelectbooleanSelects the current paragraph.
SetBetweenBorderNoneSpecifies the border which will be displayed between each paragraph in a set of paragraphs which have the same set of paragraph border settings.
SetBoldApiParagraphSets the bold property to the text character.
SetBottomBorderNoneSpecifies the border which will be displayed below a set of paragraphs which have the same paragraph border settings.\ 💡 The paragraphs of the same style going one by one are considered as a single block, so the border is added\ to the whole block rather than to every paragraph in this block.
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 in the RGB format.
SetContextualSpacingNoneSpecifies that any space before or after this paragraph set using the \ ApiParaPr#SetSpacingBefore or ApiParaPr#SetSpacingAfter spacing element, should not be applied when the preceding and \ following paragraphs are of the same paragraph style, affecting the top and bottom spacing respectively.
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.
SetHighlightApiParagraphSpecifies a highlighting color which is applied as a background to the contents of the current paragraph.
SetIndFirstLineNoneSets the paragraph first line indentation.
SetIndLeftNoneSets the paragraph left side indentation.
SetIndRightNoneSets the paragraph right side indentation.
SetItalicApiParagraphSets the italic property to the text character.
SetJcNoneSets the paragraph contents justification.
SetKeepLinesNoneSpecifies that when rendering the document using a page view, all lines of the current paragraph are maintained on a single page whenever possible.
SetKeepNextNoneSpecifies that when rendering the document using a paginated view, the contents of the current paragraph are at least\ partly rendered on the same page as the following paragraph whenever possible.
SetLeftBorderNoneSpecifies the border which will be displayed at the left side of the page around the specified paragraph.
SetNumPrNoneSpecifies that the current paragraph references a numbering definition instance in the current document.
SetNumberingNoneSpecifies that the current paragraph references the numbering definition instance in the current document.
SetOutlineLvlbooleanSets the outline level for the specified properties.
SetPageBreakBeforeNoneSpecifies that when rendering the document using a paginated view, the contents of the current paragraph are rendered at\ the beginning of a new page in the document.
SetPositionApiParagraphSpecifies an amount by which text is raised or lowered for this paragraph in relation to the default\ baseline of the surrounding non-positioned text.
SetRightBorderNoneSpecifies the border which will be displayed at the right side of the page around the specified paragraph.
SetSectionbooleanSets the specified section to the current paragraph.
SetShdNoneSpecifies the shading applied to the contents of the paragraph.
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.
SetSpacingAfterNoneSets the spacing after the current paragraph. If the value of the isAfterAuto parameter is true, then \ any value of the nAfter is ignored. If isAfterAuto parameter is not specified, then it \ will be interpreted as false.
SetSpacingBeforeNoneSets the spacing before the current paragraph. If the value of the isBeforeAuto parameter is true, then \ any value of the nBefore is ignored. If isBeforeAuto parameter is not specified, then \ it will be interpreted as false.
SetSpacingLineNoneSets the paragraph line spacing. If the value of the sLineRule parameter is either \ "atLeast" or "exact", then the value of nLine will be interpreted as twentieths of a point. If \ the value of the sLineRule parameter is "auto", then the value of the \ nLine parameter will be interpreted as 240ths of a line.
SetStrikeoutApiParagraphSpecifies that the contents of this paragraph are displayed with a single horizontal line through the center of the line.
SetStyleNoneThe paragraph style base method.\ 💡 This method is not used by itself, as it only forms the basis for the ApiParagraph#SetStyle method which sets the selected or created style for the paragraph.
SetTabsNoneSpecifies a sequence of custom tab stops which will be used for any tab characters in the current paragraph.\ -Warning: The lengths of aPos array and aVal array -MUST BE equal to each other.
SetTextPrbooleanSets the paragraph text properties.
SetTopBorderNoneSpecifies the border which will be displayed above a set of paragraphs which have the same set of paragraph border settings.\ 💡 The paragraphs of the same style going one by one are considered as a single block, so the border is added to the whole block rather than to every paragraph in this block.
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).
SetVertAlignApiParagraph | nullSpecifies the alignment which will be applied to the contents of this paragraph in relation to the default appearance of the paragraph text:\ -"baseline" - the characters in the current paragraph will be aligned by the default text baseline.\ -"subscript" - the characters in the current paragraph will be aligned below the default text baseline.\ -"superscript" - the characters in the current paragraph will be aligned above the default text baseline.
SetWidowControlNoneSpecifies whether a single line of the current paragraph will be displayed on a separate page from the remaining content at display time by moving the line onto the following page.
ToJSONJSONConverts the ApiParagraph object into the JSON object.
ToJSONJSONConverts the ApiParaPr object into the JSON object.
WrapInMailMergeFieldNoneWraps the paragraph content in a mail merge field.