Word JS API Docs
TypeScript Definitions
Basics
Content Controls
- On adding content controls - Registers, triggers, and deregisters onAdded event that tracks the addition of content controls.
- On changing data in content controls - Registers, triggers, and deregisters onDataChanged event that tracks when data is changed in content controls.
- On deleting content controls - Registers, triggers, and deregisters onDeleted event that tracks the removal of content controls.
- On entering content controls - Registers, triggers, and deregisters onEntered event that tracks when the cursor is placed within content controls.
- On exiting content controls - Registers, triggers, and deregisters onExited event that tracks when the cursor is removed from within content controls.
- On changing selection in content controls - Registers, triggers, and deregisters onSelectionChanged event that tracks when selections are changed in content controls.
- Get change tracking states of content controls - Gets change tracking states of content controls.
- Manage checkbox content controls - Inserts, updates, retrieves, and deletes checkbox content controls.
- Manage combo box content controls - Inserts, updates, and deletes combo box content controls.
- Content control basics - Inserts, updates, and retrieves content controls.
- Manage dropdown list content controls - Inserts, updates, and deletes dropdown list content controls.
Images
Lists
Paragraph
Properties
Ranges
Tables
- Manage custom table style - Shows how to manage primarily margins and alignments of a custom table style in the current document.
- Table formatting - Gets the formatting details of a table, a table row, and a table cell, including borders, alignment, and cell padding.
- Create and access a table - Creates a table and accesses a specific cell.
Document
- Compare documents - Compares two documents (the current one and a specified external one).
- Get styles from external document - This sample shows how to get styles from an external document.
- Insert an external document - Inserts the content (with or without settings) of an external document into the current document. Settings include formatting, change-tracking mode, custom properties, and XML parts.
- Add a section - Shows how to insert section breaks in the document.
- Manage annotations - Shows how to leverage the Writing Assistance API to manage annotations and use annotation events.
- Manage body - Shows how to manage the document body.
- Track changes - This sample shows how to get and set the change tracking mode and get the before and after of reviewed text.
- Manage comments - This sample shows how to perform basic comments operations, including insert, reply, get, edit, resolve, and delete.
- Manage a CustomXmlPart with the namespace - This sample shows how to add, query, replace, edit, and delete a custom XML part in a document.
- Manage a CustomXmlPart without the namespace - This sample shows how to add, query, edit, and delete a custom XML part in a document.
- Manage fields - This sample shows how to perform basic operations on fields, including insert, get, and delete.
- Manage footnotes - This sample shows how to perform basic footnote operations, including insert, get, and delete.
- Manage settings - This sample shows how to add, edit, get, and delete custom settings on a document.
- Manage styles - This sample shows how to perform operations on the styles in the current document and how to add and delete custom styles.
- Manage tracked changes - This samples shows how to manage tracked changes, including accepting and rejecting changes.
- Manage document save and close - Shows how to manage saving and closing document.
Scenarios
Preview Apis
- Content control basics - Inserts, updates, and retrieves content controls.
- Manage comments - This sample shows how to perform operations on comments (including insert, reply, get, edit, resolve, and delete) and use comment events.
Other