Skip to main content

ApiDocument

Represents the ApiDocument class.

Methods

MethodReturnsDescription
AcceptAllRevisionChangesNoneAccepts all changes made in review mode.
AddCommentApiCommentAdds a comment to the current document selection, or to the current word if no text is selected.
AddDrawingToPagebooleanAdds a shape to the specified page.\ 💡 This method can be a little bit slow, because it runs the document calculation\ process to arrange tables on the specified page.
AddElementNoneAdds 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).
AddMathEquationNoneAdds a math equation to the current document.
AddTableOfContentsNoneAdds a table of content to the current document.\ 💡 Please note that the new table of contents replaces the existing table of contents.
AddTableOfFiguresbooleanAdds a table of figures to the current document.
ClearAllFieldsNoneClears all forms in the document.
CreateNewHistoryPointNoneCreates a new history point.
CreateNumberingApiNumberingCreates an abstract multilevel numbering with a specified type.
CreateSectionApiSection | nullCreates a new document section which ends at the specified paragraph. Allows to set local parameters to the current\ section - page size, footer, header, columns, etc.
CreateStyleApiStyleCreates a new style with the specified type and name. If there is a style with the same name it will be replaced with a new one.
DeleteBookmarkbooleanRemoves a bookmark from the document, if one exists.
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.
GetAllTablesApiParagraph[]Returns an array of all tables from the current document content.
GetAllTablesOnPageApiTable[]Returns a collection of tables on a given absolute page.\ 💡 This method can be a little bit slow, because it runs the document calculation\ process to arrange tables on the specified 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.
GetClassType"documentContent"Returns a type of the ApiDocumentContent 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.
GetCurrentPagenumberReturns the index of the current page.
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.
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:\ -Application - the application the document was created with.\ -CreatedRaw - the date and time when the file was created.\ -Created - the parsed date and time when the file was created.\ -LastModifiedRaw - the date and time when the file was last modified.\ -LastModified - the parsed date and time when the file was last modified.\ -LastModifiedBy - the name of the user who made the latest change to the document.\ -Authors - the persons who created the file.\ -Title - the document title (this property allows you to simplify your documents classification).\ -Tags - the document tags (this property allows you to simplify your documents classification).\ -Subject - the document subject (this property allows you to simplify your documents classification).\ -Comment - the comment to the document (this property allows you to simplify your documents classification).
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.
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.\ If a form was created and not assigned to any part of the document, it won't appear in this list.
GetPageCountnumberReturns a number of pages in the current document.\ 💡 This method can be slow for large documents because it runs the document calculation\ process before the full recalculation.
GetRangeApiRangeReturns a Range object that represents the part of the document contained in the specified document.
GetRangeApiRangeReturns a Range object that represents the part of the document contained in the document content.
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.
GetSelectedDrawingsApiShape[] | ApiImage[] | ApiChart[] | ApiDrawing[]Returns all the selected drawings in the current document.
GetStatisticsobjectReturns the document statistics represented as an object with the following parameters:\ -PageCount - number of pages;\ -WordsCount - number of words;\ -ParagraphCount - number of paragraphs;\ -SymbolsCount - number of symbols;\ -SymbolsWSCount - number of symbols with spaces.
GetStyleApiStyleReturns 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.
GroupDrawingsApiGroupGroups an array of drawings in the current document.
InsertContentbooleanInserts an array of elements into the current position of the document.
InsertWatermarkbooleanInserts a watermark on each document page.
IsTrackRevisionsbooleanChecks if change tracking mode is enabled or not.
LastDocumentElementReturns the last document element.
PushbooleanPushes a paragraph or a table to actually add it to the document.
RejectAllRevisionChangesNoneRejects all changes made in review mode.
RemoveAllElementsNoneRemoves all the elements from the current document or from the current document element.\ 💡 When all elements are removed, a new empty paragraph is automatically created. If you want to add\ content to this paragraph, use the ApiDocumentContent#GetElement method.
RemoveElementNoneRemoves an element using the position specified.
RemoveSelectionNoneRemoves the current selection.
RemoveWatermarkNoneRemoves a watermark from the current document.
ReplaceCurrentImageNoneReplaces 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.
SearchAndReplaceNoneFinds and replaces the text.
SelectCurrentWordobjectSelects the current word if it is possible.
SetControlsHighlightNoneSets the highlight to the content controls from the current document.
SetEvenAndOddHdrFtrNoneSpecifies whether sections in this document will have different headers and footers for even and\ odd pages (one header/footer for odd pages and another header/footer for even pages).
SetFormsDataNoneSets the data to the specified forms.
SetFormsHighlightNoneSets the highlight to the forms in the document.
SetTrackRevisionsNoneSets the change tracking mode.
SetWatermarkSettingsApiDrawingSets the watermark settings in the current document.
ToHtmlstringConverts a document to HTML.
ToJSONJSONConverts the ApiDocument object into the JSON object.
ToJSONJSONConverts the ApiDocumentContent object into the JSON object.
ToMarkdownstringConverts a document to Markdown.
UpdateAllFieldsNoneUpdates all fields in the document.
UpdateAllTOCNoneUpdates all tables of contents in the current document.
UpdateAllTOFNoneUpdates all tables of figures in the current document.