I'm trying to develop word add-in which allows to modify word content. One of the requirement is to select some text and mark it:
- change its style (look) - and that is done
- Associate that piece of text with some custom/hidden data, ex. an ID.
I want to somehow persist that data within the document, so that:
- My add-in can read the document on the start and build a list of 'marked' elements
- It should work on different machines - I can create a document on one machine, later open in on other machine, and add-in should be able to retrieve that data.
So far I tried to persist that data by first, getting data as HTML, and add attributes to tags, but that didn't work. Also tried to add some hidden div, but it was only available during word app lifetime. Recently, found this link: https://github.com/OfficeDev/Excel-Add-in-JavaScript-PersistCustomSettings , but still it allows to persist data in scope of "browser", so, I assume that on other machine it won't work.
What are my possibilities? Maybe I shouldn't store it within a document, but if not, where?
Developing it using office-js - it should work for both Word 2013 and Word 2016 (so I don't have an access to Word 2016 specific API).