Docs API Reference

Context object

Represents the runtime environment of the add-in and provides access to key objects of the API.

Hosts: Access, Excel, Outlook, PowerPoint, Project, Word
Last changed in 1.1
Office.context

Members

Properties

Name Description
commerceAllowed Gets whether the add-in is running on a platform that allows links to external payment systems.
contentLanguage Gets the locale (language) for data as it is stored in the document or item.
displayLanguage Gets the locale (language) for the UI of the hosting application.
document Gets an object that represents the document the content or task pane add-in is interacting with.
mailbox Gets the mailbox object that provides access to members of the API that are specifically for Outlook add-ins.
officeTheme Provides access to the properties for Office theme colors
roamingSettings Gets an object that represents the saved custom settings of the add-in.
touchEnabled Gets whether the add-in is running in an Office host application that is touch enabled.

Remarks

The Context object provides access to key objects in the JavaScript API for Office.

Support details

Minimum permission level Restricted
Add-in types Content, task pane, Outlook
Library Office.js
Namespace Office

Support history


Version Changes
1.1 Added commerceAllowed and touchEnabledAdded properties (Excel, PowerPoint and Word on Office for iPad only).
1.1 Added support for add-ins with Excel and Word on Office for iPad.
1.1 For contentLanguage, displayLanguage, and document, added support for content add-ins for Access.
1.0 Introduced