Skip to main content

ApiDocument

ApiDocument is a subclass of ApiDocumentContent.

Methods

MethodReturnsDescription
AcceptAllRevisionChangesbooleanAccepts all changes made in review mode.
AddCheckBoxContentControlApiInlineLvlSdtAdds a new checkbox content control to the document.
AddComboBoxContentControlApiInlineLvlSdtAdds a new combo box content control to the document.
AddCommentApiCommentAdds a comment to the current document selection, or to the current word if no text is selected.
AddDatePickerContentControlApiInlineLvlSdtAdds a new date picker content control to the document.
AddDrawingToPagebooleanAdds a drawing to the specified page.
AddDropDownListContentControlApiInlineLvlSdtAdds a new drop-down list content control to the document.
AddElementbooleanAdds a paragraph or a table or a blockLvl content control using its position in the document content.
AddEndnoteApiDocumentContentAdds an endnote for the selected text (or the current position if the selection doesn't exist).
AddFootnoteApiDocumentContentAdds a footnote for the selected text (or the current position if the selection doesn't exist).
AddMathEquationbooleanAdds a math equation to the current document.
AddParagraphApiParagraphCreates a new paragraph and appends it to the end of the document content.
AddPictureContentControlApiInlineLvlSdtAdds a new picture content control to the document.
AddTableOfContentsbooleanAdds a table of content to the current document.
AddTableOfFiguresbooleanAdds a table of figures to the current document.
AddTextApiRunAppends the specified text to the end of the document content.
ClearAllFieldsbooleanClears all forms in the document.
CreateNewHistoryPointbooleanCreates a new history point.
CreateNumberingApiNumberingCreates an abstract multilevel numbering with a specified type.
CreateParagraphApiParagraphCreates a new empty paragraph.
CreateSectionApiSection | nullCreates a new document section which ends at the specified paragraph. Allows to set local parameters to the current
CreateStyleApiStyleCreates a new style with the specified type and name. If a style with the specified name already exists, it will be returned without creating a new one.
CreateTableApiTableCreates a new table with a specified number of rows and columns.
DeleteBookmarkbooleanRemoves a bookmark from the document, if one exists.
EnterTextbooleanAdd text to the document on the cursor position.
GetAllBookmarksNamesstring[]Returns an array with names of all bookmarks in the current document.
GetAllCaptionParagraphsApiParagraph[]Returns all caption paragraphs of the specified type from the current document.
GetAllChartsApiChart[]Returns a collection of chart objects from the document content.
GetAllCommentsApiComment[]Returns all comments from the current document.
GetAllContentControlsApiBlockLvlSdt[] | ApiInlineLvlSdt[]Returns a list of all the content controls from the document.
GetAllDrawingObjectsDrawing[]Returns a collection of drawing objects from the document content.
GetAllFormsApiForm[]Returns all existing forms in the document.
GetAllHeadingParagraphsApiParagraph[]Returns all heading paragraphs from the current document.
GetAllImagesApiImage[]Returns a collection of image objects from the document content.
GetAllNumberedParagraphsApiParagraph[]Returns all numbered paragraphs from the current document.
GetAllOleObjectsApiOleObject[]Returns a collection of OLE objects from the document content.
GetAllParagraphsApiParagraph[]Returns an array of all paragraphs from the current document content.
GetAllShapesApiShape[]Returns a collection of shape objects from the document content.
GetAllStylesApiStyle[]Returns all styles of the current document.
GetAllTablesApiTable[]Returns an array of all tables from the current document content.
GetAllTablesOnPageApiTable[]Returns a collection of tables on a given absolute page.
GetBookmarkApiBookmarkReturns a bookmark by its name from the current document.
GetBookmarkRangeApiRange | nullReturns a bookmark range.
GetClassType"document"Returns a type of the ApiDocument class.
GetCommentByIdApiCommentReturns a comment from the current document by its ID.
GetCommentsReportCommentReportReturns a report about all the comments added to the document.
GetContentDocumentElement[]Returns an array of document elements from the current ApiDocumentContent object.
GetContentControlsByTagApiBlockLvlSdt[] | ApiInlineLvlSdt[]Returns a list of all content controls in the document with the specified tag name.
GetControlsHighlightApiColor | nullReturns the highlight color of the content controls in the current document.
GetCoreApiCoreRetrieves the core properties interface for the current document.
GetCurrentContentControlApiBlockLvlSdt | ApiInlineLvlSdt | nullReturns the currently selected content control.
GetCurrentFootEndnoteApiDocumentContentReturns the footnote or endnote content if the cursor is currently inside one, otherwise returns null.
GetCurrentPagenumberReturns the index of the current page.
GetCurrentParagraphApiParagraphReturns the current paragraph where the cursor is located.
GetCurrentRunApiRunReturns the current run where the cursor is located.
GetCurrentSentencestringReturns the current sentence or part of the current sentence.
GetCurrentVisiblePagesnumber[]Returns the indexes of the currently visible pages.
GetCurrentWordstringReturns the current word or part of the current word.
GetCustomPropertiesApiCustomPropertiesRetrieves the custom properties from the document.
GetCustomXmlPartsApiCustomXmlParts | nullRetrieves the custom XML manager associated with the document.
GetDefaultParaPrApiParaPrReturns a set of default paragraph properties in the current document.
GetDefaultStyleApiStyleReturns the default style parameters for the specified document element.
GetDefaultTextPrApiTextPrReturns a set of default properties for the text run in the current document.
GetDocumentInfoobjectReturns the document information:
GetDocumentVisitorApiDocumentVisitorReturns a visitor object for traversing the elements of the current document.
GetDrawingsByNameApiDrawing[]Returns a collection of drawing objects from the document filtered by their names.
GetElementDocumentElementReturns an element by its position in the document.
GetElementsCountnumberReturns a number of elements in the current document.
GetEndNotesFirstParagraphsApiParagraph[]Returns the first paragraphs from all endnotes in the current document.
GetFinalSectionApiSectionReturns the document final section.
GetFootnotesFirstParagraphsApiParagraph[]Returns the first paragraphs from all footnotes in the current document.
GetFormKeysByRolestring[]Returns a list of all form keys attached to the specified role.
GetFormValueByKeynull | boolean | stringReturns the form value for the specified key. For a group of radio buttons returns Choice, i.e. the name of the selected item.
GetFormsByKeyApiForm[]Returns a list of all forms in the document with the specified key.
GetFormsByRoleApiForm[]Returns a list of all forms in the document with the specified role name.
GetFormsByTagApiForm[]Returns a list of all forms in the document with the specified tag name.
GetFormsDataFormData[]Returns the data from all forms present in the current document.
GetFormsHighlightApiColor | nullReturns the highlight color of the forms in the document.
GetInternalIdstringReturns an internal ID of the current document content.
GetPageCountnumberReturns a number of pages in the current document.
GetRangeApiRangeReturns a Range object that represents the part of the document contained in the specified document.
GetRangeBySelectApiRange | nullReturns a range object by the current selection.
GetReviewReportReviewReportReturns a report about every change which was made to the document in the review mode.
GetSectionsApiSection[]Returns a collection of section objects in the document.
GetSelectedDrawingsDrawing[]Returns all the selected drawings in the current document.
GetStatisticsobjectReturns the document statistics represented as an object with the following parameters:
GetStyleApiStyle | nullReturns a style by its name.
GetTagsOfAllContentControlsString[]Returns a list of all tags that are used for all content controls in the document.
GetTagsOfAllFormsString[]Returns a list of all tags that are used for all forms in the document.
GetTextstringReturns the inner text of the current document content object.
GetWatermarkSettingsApiWatermarkSettingsReturns the watermark settings in the current document.
GoToPagebooleanMoves a cursor to the start of the specified page in the document.
GroupDrawingsApiGroupGroups an array of drawings in the current document.
InsertBlankPagebooleanInserts a blank page to the current location.
InsertContentbooleanInserts an array of elements into the current position of the document.
InsertParagraphBreakbooleanAdd paragraph to the document on the cursor position.
InsertWatermarkbooleanInserts a watermark on each document page.
IsEndnotebooleanCheck if the current document content is an endnote.
IsFootnotebooleanCheck if the current document content is a footnote.
IsTrackRevisionsbooleanChecks if change tracking mode is enabled or not.
LastDocumentElementReturns the last document element.
MoveCursorDownbooleanMoves the cursor down.
MoveCursorLeftbooleanMoves the cursor to the left.
MoveCursorRightbooleanMoves the cursor to the right.
MoveCursorToEndbooleanMoves a cursor to the end of the document.
MoveCursorToNoteReferencebooleanMoves the cursor to the reference of this footnote/endnote in the main document. If this document content is not a footnote/endnote, does nothing.
MoveCursorToPosbooleanMoves a cursor to a specified position of the current document.
MoveCursorToStartbooleanMoves a cursor to the start of the document.
MoveCursorUpbooleanMoves the cursor up.
PushbooleanPushes a paragraph or a table to actually add it to the document.
RejectAllRevisionChangesbooleanRejects all changes made in review mode.
RemoveAllElementsbooleanRemoves all the elements from the current document or from the current document element.
RemoveElementbooleanRemoves an element using the position specified.
RemoveSelectionbooleanRemoves the current selection.
RemoveWatermarkbooleanRemoves a watermark from the current document.
ReplaceCurrentImagebooleanReplaces the current image with an image specified.
ReplaceCurrentSentencebooleanReplaces the current sentence or part of the current sentence with the specified text.
ReplaceCurrentWordbooleanReplaces the current word or part of the current word with the specified text.
ReplaceDrawingbooleanReplaces a drawing with a new drawing.
SearchApiRange[]Searches for a scope of a document object. The search results are a collection of ApiRange objects.
SearchAndReplacebooleanFinds and replaces the text.
SelectCurrentWordobjectSelects the current word if it is possible.
SelectNoteReferencebooleanSelect the reference to this footnote/endnote. If this document content is not a footnote/endnote, do nothing.
SetAssistantTrackRevisionsbooleanEnables or disables AI-assisted change tracking in the document.
SetControlsHighlightbooleanSets the highlight to the content controls from the current document.
SetEvenAndOddHdrFtrbooleanSpecifies whether sections in this document will have different headers and footers for even and
SetFormsDatabooleanSets the data to the specified forms.
SetFormsHighlightbooleanSets the highlight to the forms in the document.
SetTextApiRunReplaces all content of the current document content object with the specified text,
SetTrackRevisionsbooleanSets the change tracking mode.
SetWatermarkSettingsApiDrawingSets the watermark settings in the current document.
ShowCommentbooleanShows a comment by its ID.
ToHtmlstringConverts a document to HTML.
ToJSONJSONConverts the ApiDocument object into the JSON object.
ToMarkdownstringConverts a document to Markdown.
UpdateAllFieldsbooleanUpdates all fields in the document.
UpdateAllTOCbooleanUpdates all tables of contents in the current document.
UpdateAllTOFbooleanUpdates all tables of figures in the current document.