I use the Settings
JavaScript API object in the Taskbar application to save several key-value pairs in a document.
My code is like this
Office.context.document.settings.set(key, value);
Office.context.document.settings.saveAsync(function () {
Toast.showToast("Setting saved", "Info saved into the document using saveAsync");
});
I also call a function saveAsync
on it to store the value.
The problem I am facing is that the settings are not saved in Word Online as the current settings. Object is not supported inWord Online
So, there is a way to find that the application is running in Word Online, so a message may be displayed, or localStorage or something else can be used to store the values.
Change . Created a publish request to add this to Word Online, you can support this feature here
Edit 2
To better explain the problem and share an example, I created an add-on sample, the manifest is located here .
Here you can enter a value for the key test
and click save, this internally calls the function saveToPropertyBag(key, value)
located at StorageLibrary.js
. This function has the above code to save the setting, and then saveAsync
is called so that the values are saved in the document.
Now you can update the browser or restart the addon and press get, the value will be available in Excel and Powerpoint, but not in Word Online.
, (Word Online), , , , .