ApiDocument
Represents the ApiDocument class.
Methods
| Method | Returns | Description |
|---|---|---|
| AcceptAllRevisionChanges | boolean | Accepts all changes made in review mode. |
| AddCheckBoxContentControl | ApiInlineLvlSdt | Adds a new checkbox content control to the document. |
| AddComboBoxContentControl | ApiInlineLvlSdt | Adds a new combo box content control to the document. |
| AddComment | ApiComment | Adds a comment to the current document selection, or to the current word if no text is selected. |
| AddDatePickerContentControl | ApiInlineLvlSdt | Adds a new date picker content control to the document. |
| AddDrawingToPage | boolean | Adds a drawing 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. |
| AddDropDownListContentControl | ApiInlineLvlSdt | Adds a new drop-down list content control to the document. |
| AddElement | boolean | Adds a paragraph or a table or a blockLvl content control using its position in the document content. |
| AddEndnote | ApiDocumentContent | Adds an endnote for the selected text (or the current position if the selection doesn't exist). |
| AddFootnote | ApiDocumentContent | Adds a footnote for the selected text (or the current position if the selection doesn't exist). |
| AddMathEquation | boolean | Adds a math equation to the current document. |
| AddPictureContentControl | ApiInlineLvlSdt | Adds a new picture content control to the document. |
| AddTableOfContents | boolean | Adds a table of content to the current document. 💡 Please note that the new table of contents replaces the existing table of contents. |
| AddTableOfFigures | boolean | Adds a table of figures to the current document. |
| ClearAllFields | boolean | Clears all forms in the document. |
| CreateNewHistoryPoint | boolean | Creates a new history point. |
| CreateNumbering | ApiNumbering | Creates an abstract multilevel numbering with a specified type. |
| CreateSection | ApiSection | null | Creates 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. |
| CreateStyle | ApiStyle | Creates 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. |
| DeleteBookmark | boolean | Removes a bookmark from the document, if one exists. |
| GetAllBookmarksNames | string[] | Returns an array with names of all bookmarks in the current document. |
| GetAllCaptionParagraphs | ApiParagraph[] | Returns all caption paragraphs of the specified type from the current document. |
| GetAllCharts | ApiChart[] | Returns a collection of chart objects from the document content. |
| GetAllComments | ApiComment[] | Returns all comments from the current document. |
| GetAllContentControls | ApiBlockLvlSdt[] | ApiInlineLvlSdt[] | Returns a list of all the content controls from the document. |
| GetAllDrawingObjects | Drawing[] | Returns a collection of drawing objects from the document content. |
| GetAllForms | ApiForm[] | Returns all existing forms in the document. |
| GetAllHeadingParagraphs | ApiParagraph[] | Returns all heading paragraphs from the current document. |
| GetAllImages | ApiImage[] | Returns a collection of image objects from the document content. |
| GetAllNumberedParagraphs | ApiParagraph[] | Returns all numbered paragraphs from the current document. |
| GetAllOleObjects | ApiOleObject[] | Returns a collection of OLE objects from the document content. |
| GetAllParagraphs | ApiParagraph[] | Returns an array of all paragraphs from the current document content. |
| GetAllShapes | ApiShape[] | Returns a collection of shape objects from the document content. |
| GetAllStyles | ApiStyle[] | Returns all styles of the current document. |
| GetAllTables | ApiTable[] | Returns an array of all tables from the current document content. |
| GetAllTablesOnPage | ApiTable[] | 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. |
| GetBookmark | ApiBookmark | Returns a bookmark by its name from the current document. |
| GetBookmarkRange | ApiRange | null | Returns a bookmark range. |
| GetClassType | "document" | Returns a type of the ApiDocument class. |
| GetCommentById | ApiComment | Returns a comment from the current document by its ID. |
| GetCommentsReport | CommentReport | Returns a report about all the comments added to the document. |
| GetContent | DocumentElement[] | Returns an array of document elements from the current ApiDocumentContent object. |
| GetContentControlsByTag | ApiBlockLvlSdt[] | ApiInlineLvlSdt[] | Returns a list of all content controls in the document with the specified tag name. |
| GetCore | ApiCore | Retrieves the core properties interface for the current document. This method is used to view or modify standard metadata such as title, author, and keywords. |
| GetCurrentContentControl | ApiBlockLvlSdt | ApiInlineLvlSdt | null | Returns the currently selected content control. |
| GetCurrentPage | number | Returns the index of the current page. |
| GetCurrentParagraph | ApiParagraph | Returns the current paragraph where the cursor is located. |
| GetCurrentRun | ApiRun | Returns the current run where the cursor is located. |
| GetCurrentSentence | string | Returns the current sentence or part of the current sentence. |
| GetCurrentVisiblePages | number[] | Returns the indexes of the currently visible pages. |
| GetCurrentWord | string | Returns the current word or part of the current word. |
| GetCustomProperties | ApiCustomProperties | Retrieves the custom properties from the document. |
| GetCustomXmlParts | ApiCustomXmlParts | null | Retrieves the custom XML manager associated with the document. This manager allows manipulation and access to custom XML parts within the document. |
| GetDefaultParaPr | ApiParaPr | Returns a set of default paragraph properties in the current document. |
| GetDefaultStyle | ApiStyle | Returns the default style parameters for the specified document element. |
| GetDefaultTextPr | ApiTextPr | Returns a set of default properties for the text run in the current document. |
| GetDocumentInfo | object | Returns 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). |
| GetDocumentVisitor | ApiDocumentVisitor | Returns a visitor object for traversing the elements of the current document. |
| GetElement | DocumentElement | Returns an element by its position in the document. |
| GetElementsCount | number | Returns a number of elements in the current document. |
| GetEndNotesFirstParagraphs | ApiParagraph[] | Returns the first paragraphs from all endnotes in the current document. |
| GetFinalSection | ApiSection | Returns the document final section. |
| GetFootnotesFirstParagraphs | ApiParagraph[] | Returns the first paragraphs from all footnotes in the current document. |
| GetFormKeysByRole | string[] | Returns a list of all form keys attached to the specified role. |
| GetFormValueByKey | null | boolean | string | Returns the form value for the specified key. For a group of radio buttons returns Choice, i.e. the name of the selected item. |
| GetFormsByKey | ApiForm[] | Returns a list of all forms in the document with the specified key. |
| GetFormsByRole | ApiForm[] | Returns a list of all forms in the document with the specified role name. |
| GetFormsByTag | ApiForm[] | Returns a list of all forms in the document with the specified tag name. |
| GetFormsData | FormData[] | 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. |
| GetInternalId | string | Returns an internal ID of the current document content. |
| GetPageCount | number | Returns 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. |
| GetRange | ApiRange | Returns a Range object that represents the part of the document contained in the specified document. |
| GetRangeBySelect | ApiRange | null | Returns a range object by the current selection. |
| GetReviewReport | ReviewReport | Returns a report about every change which was made to the document in the review mode. |
| GetSections | ApiSection[] | Returns a collection of section objects in the document. |
| GetSelectedDrawings | ApiShape[] | ApiImage[] | ApiChart[] | ApiDrawing[] | Returns all the selected drawings in the current document. |
| GetStatistics | object | Returns 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. |
| GetStyle | ApiStyle | Returns a style by its name. |
| GetTagsOfAllContentControls | String[] | Returns a list of all tags that are used for all content controls in the document. |
| GetTagsOfAllForms | String[] | Returns a list of all tags that are used for all forms in the document. |
| GetText | string | Returns the inner text of the current document content object. |
| GetWatermarkSettings | ApiWatermarkSettings | Returns the watermark settings in the current document. |
| GoToPage | boolean | Moves a cursor to the start of the specified page in the document. |
| GroupDrawings | ApiGroup | Groups an array of drawings in the current document. |
| InsertBlankPage | boolean | Inserts a blank page to the current location. |
| InsertContent | boolean | Inserts an array of elements into the current position of the document. |
| InsertWatermark | boolean | Inserts a watermark on each document page. |
| IsTrackRevisions | boolean | Checks if change tracking mode is enabled or not. |
| Last | DocumentElement | Returns the last document element. |
| MoveCursorToEnd | boolean | Moves a cursor to the end of the document. |
| MoveCursorToPos | boolean | Moves a cursor to a specified position of the current document. If there is any selection in the document, it will be removed. |
| MoveCursorToStart | boolean | Moves a cursor to the start of the document. |
| Push | boolean | Pushes a paragraph or a table to actually add it to the document. |
| RejectAllRevisionChanges | boolean | Rejects all changes made in review mode. |
| RemoveAllElements | boolean | Removes 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. |
| RemoveElement | boolean | Removes an element using the position specified. |
| RemoveSelection | boolean | Removes the current selection. |
| RemoveWatermark | boolean | Removes a watermark from the current document. |
| ReplaceCurrentImage | boolean | Replaces the current image with an image specified. |
| ReplaceCurrentSentence | boolean | Replaces the current sentence or part of the current sentence with the specified text. |
| ReplaceCurrentWord | boolean | Replaces the current word or part of the current word with the specified text. |
| ReplaceDrawing | boolean | Replaces a drawing with a new drawing. |
| Search | ApiRange[] | Searches for a scope of a document object. The search results are a collection of ApiRange objects. |
| SearchAndReplace | boolean | Finds and replaces the text. |
| SelectCurrentWord | object | Selects the current word if it is possible. |
| SetAssistantTrackRevisions | boolean | Enables or disables AI-assisted change tracking in the document. |
| SetControlsHighlight | boolean | Sets the highlight to the content controls from the current document. |
| SetEvenAndOddHdrFtr | boolean | Specifies 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). |
| SetFormsData | boolean | Sets the data to the specified forms. |
| SetFormsHighlight | boolean | Sets the highlight to the forms in the document. |
| SetTrackRevisions | boolean | Sets the change tracking mode. |
| SetWatermarkSettings | ApiDrawing | Sets the watermark settings in the current document. |
| ShowComment | boolean | Shows a comment by its ID. |
| ToHtml | string | Converts a document to HTML. |
| ToJSON | JSON | Converts the ApiDocument object into the JSON object. |
| ToMarkdown | string | Converts a document to Markdown. |
| UpdateAllFields | boolean | Updates all fields in the document. |
| UpdateAllTOC | boolean | Updates all tables of contents in the current document. |
| UpdateAllTOF | boolean | Updates all tables of figures in the current document. |