See Using the application-specific API model to learn about the asynchronous nature of the Word APIs and how they work with the document.
Office.js APIs for Word
Common APIs: The Common API can be used to access features such as UI, dialogs, and client settings that are common across multiple types of Office applications.
- Context: The
Contextobject 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
officeThemeand also provides information about the add-in's runtime environment such as
platform. Additionally, it provides the
requirements.isSetSupported()method, which you can use to check whether a specified requirement set is supported by the Excel application where the add-in is running.
- Document: The
Documentobject provides the
getFileAsync()method, which you can use to download the Word file where the add-in is running.
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.