Chandan
Chandan

Reputation: 185

How to store the values in Office js for add ins?

I'm creating a word add-in using react js.

Currently, I'm using the browser local storage to store the values. Due to using local storage, the Word add-in is working as expected with Word Online but not with Word 2016.

Upvotes: 1

Views: 222

Answers (1)

Kim Brandl
Kim Brandl

Reputation: 13480

Using the Office.js API, you can use the Settings object (Office.context.document.settings) to store data (as name/value pairs) in the host document. For details about how this works, see the documentation here:

As the documentation indicates, the settings that you create/save using the Settings object are saved per add-in and per document.

Upvotes: 1

Related Questions