Export (0) Print
Expand All

Settings object (JavaScript API for Office v1.1)

JavaScript API for Office v1.1

Represents custom settings for a task pane or content app that are stored in the host document as name/value pairs.

Last modified: June 12, 2014

Office.context.document.settings

Methods

Name

Description

Updates for Office.js v1.1

addHandlerAsync

Adds an event handler for the settingsChanged event.

get

Retrieves the specified setting.

Added support for custom settings in content apps for Access.

refreshAsync

Reads all settings persisted in the document and refreshes the app's copy of those settings held in memory.

Added support for custom settings in content apps for Access.

remove

Removes the specified setting.

Added support for custom settings in content apps for Access.

removeHandlerAsync

Removes an event handler for the settingsChanged event.

saveAsync

Saves the settings.

Added support for custom settings in content apps for Access.

set

Sets or creates the specified setting.

Added support for custom settings in content apps for Access.

Events

Name

Description

settingsChanged

Occurs when a setting is changed.

The settings created by using the methods of the Settings object are saved per app and per document. That is, they are available only to the app that created them, and only from the document in which they are saved.

The name of a setting is a string, while the value can be a string, number, boolean, null, object, or array.

The Settings object is automatically loaded as part of the Document object, and is available by calling the settings property of that object when the app is activated. The developer is responsible for calling the saveAsync method after adding or deleting settings to save the settings in the document.

App types

Content apps, Task pane apps

Supported clients

Access app for SharePoint, Excel 2013, Excel Online, Excel 2013 SP1, Excel 2013 RT, Word 2013, Word 2013 SP1, Word 2013 RT, PowerPoint 2013, PowerPoint 2013 SP1, PowerPoint 2013 RT

Library

Office.js

Namespace

Office

Show:
© 2014 Microsoft