ApiDocument
Represents the ApiDocument class.
Methods
Method | Returns | Description |
---|---|---|
AcceptAllRevisionChanges | None | Accepts all changes made in review mode. |
AddComment | ApiComment | Adds a comment to the current document selection, or to the current word if no text is selected. |
AddDrawingToPage | boolean | Adds 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. |
AddElement | None | 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 | None | Adds a math equation to the current document. |
AddTableOfContents | None | 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 | None | Clears all forms in the document. |
CreateNewHistoryPoint | None | 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 | ApiParagraph[] | 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. |
GetClassType | "documentContent" | Returns a type of the ApiDocumentContent 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. |
GetCurrentPage | number | Returns the index of the current page. |
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. |
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). |
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. |
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. |
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. |
GetRange | ApiRange | Returns a Range object that represents the part of the document contained in the document content. |
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. |
GroupDrawings | ApiGroup | Groups an array of drawings in the current document. |
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. |
Push | boolean | Pushes a paragraph or a table to actually add it to the document. |
RejectAllRevisionChanges | None | Rejects all changes made in review mode. |
RemoveAllElements | None | 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 | None | Removes an element using the position specified. |
RemoveSelection | None | Removes the current selection. |
RemoveWatermark | None | Removes a watermark from the current document. |
ReplaceCurrentImage | None | 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 | None | Finds and replaces the text. |
SelectCurrentWord | object | Selects the current word if it is possible. |
SetControlsHighlight | None | Sets the highlight to the content controls from the current document. |
SetEvenAndOddHdrFtr | None | 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 | None | Sets the data to the specified forms. |
SetFormsHighlight | None | Sets the highlight to the forms in the document. |
SetTrackRevisions | None | Sets the change tracking mode. |
SetWatermarkSettings | ApiDrawing | Sets the watermark settings in the current document. |
ToHtml | string | Converts a document to HTML. |
ToJSON | JSON | Converts the ApiDocument object into the JSON object. |
ToJSON | JSON | Converts the ApiDocumentContent object into the JSON object. |
ToMarkdown | string | Converts a document to Markdown. |
UpdateAllFields | None | Updates all fields in the document. |
UpdateAllTOC | None | Updates all tables of contents in the current document. |
UpdateAllTOF | None | Updates all tables of figures in the current document. |