Context object (JavaScript API for Office)

Office Add-ins

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

Last modified: June 19, 2015

Note Note

The name "apps for Office" is changing to "Office Add-ins". During the transition, the documentation and the UI of some Office host applications and Visual Studio tools might still use the term "apps for Office". For details, see New name for apps for Office and SharePoint.

Hosts:

Access, Excel, Outlook, PowerPoint, Project, Word

Last changed in

1.1

See all support details

Office.context

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 app is interacting with.

mailbox

Gets the mailbox object that provides access to members of the API that are specifically for mail apps.

roamingSettings

Gets an object that represents the saved custom settings of the app.

touchEnabled

Gets whether the add-in is running in an Office host application that is touch enabled.

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

Minimum permission level

Restricted

App types

Content, mail, task pane

Library

Office.js

Namespace

Office

Version

Changes

1.1

Added commerceAllowed and touchEnabledAdded properties (Excel 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 apps for Access.

1.0

Introduced

Show:
© 2015 Microsoft