A Word add-in interacts with objects in Word by using the Office JavaScript API. This includes two JavaScript object models:
Word JavaScript API: The Word JavaScript API provides strongly-typed objects that work with the document, ranges, tables, lists, formatting, and more.
Common APIs: The Common API give access to features such as UI, dialogs, and client settings that are common across multiple Office applications.
While you'll likely use the Word JavaScript API to develop the majority of functionality in add-ins that target Word, you'll also use objects in the Common API. For example:
Office.Context: The Context object represents the runtime environment of the add-in and provides access to key objects of the API. It consists of document configuration details such as contentLanguage and officeTheme and also provides information about the add-in's runtime environment such as host and platform. Additionally, it provides the requirements.isSetSupported() method, which you can use to check whether a specified requirement set is supported by the Word application where the add-in is running.
Office.Document: The Office.Document object provides the getFileAsync() method, which you can use to download the Word file where the add-in is running. This is separate from the Word.Document object.
Word-specific object model
To understand the Word APIs, you must understand how the components of a document are related to one another.
The Document contains the Sections, and document-level entities such as settings and custom XML parts.
A Section contains a Body.
A Body gives access to Paragraphs, ContentControls, and Range objects, among others.
A Range represents a contiguous area of content, including text, white space, Tables, and images. It also contains most of the text manipulation methods.
A List represents text in a numbered or bulleted list.
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Office Add-ins feedback
Office Add-ins is an open source project. Select a link to provide feedback:
Demonstrate that you have the skills needed to get the most out of Word (Microsoft 365 Apps) by earning a Microsoft Office Specialist (MOS) certification.