Office object (JavaScript API for Office)

apps for Office

Represents an instance of an app, which provides access to the top-level objects of the API.

Last modified: June 22, 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

Properties

Name

Description

context

Gets the Context object that represents the runtime environment of the app and provides access to the top-level objects of the API.

cast.item

Provides IntelliSense in Visual Studio specific to compose or read mode messages and appointments.

Note Note

Only applicable at design time when developing mail apps in Visual Studio.

Methods

Name

Description

select

Creates a promise to return a binding based on the selector string passed in.

useShortNamespace

Toggles on and off the Office alias for the full Microsoft.Office.WebExtension namespace.

Events

Name

Description

initialize

Occurs when the runtime environment is loaded and the app is ready to start interacting with the application and hosted document.

The Office object enables the developer to implement a callback function for the Initialize event and provides access to the Context object.

A checkmark (√) in the following matrix indicates that this object is supported in the corresponding Office host application. An empty cell indicates that the Office host application doesn't support this object.

For more information about Office host application and server requirements, see Requirements for running apps for Office.

Office for Windows desktop

Office Online
(in browser)

Office for iPad

OWA for Devices

Outlook for Mac

Access

Excel

Outlook

PowerPoint

Project

Word

App types

Content, mail, task pane

Library

Office.js

Namespace

Office

Version

Changes

1.1

Added support for Excel and Word in Office for iPad.

1.1

  • For context, added support for getting the runtime context in content apps for Access.

  • For select, added support for selecting table bindings in content apps for Access.

  • For useShortNamespace, added support for content apps for Access.

  • For initialize, added support for initialization in content apps for Access.

1.0

Introduced

Show:
© 2015 Microsoft