Reputation: 16916
I am working on an Office365 Javascript Content Addin for PowerPoint and am having trouble with messaging.
Unlike Word or Excel, it is likely multiple Add-ins will be used in one document. E.g. One on slide 3, one on slide 5.
I have 2 scenarios that are not working nicely.
What I've tried so far:
Looked through the Office.js file and documentation.
Investigated the underlying tech so expected some standard html techniques to work.
Tried both postMessage and using a storage event (which worked in IE directly, but not when in PowerPoint).
I could impement a heartbeat or websockets, but would rather avoid hitting the server unnecessarily and and would like to keep things as simple as possible. Alternatively, I could put something in localstorage and use setInterval to check it, but that would add unnecessary background work and slow the application down.
Are there any 'good' ways of solving the above mentioned problems, or is the setInterval/localstorage check the only simple solution at the moment?
Upvotes: 0
Views: 269
Reputation: 16916
Trawling through the documentation, it seems this sort of thing can be achieved using refreshAsync.
Upvotes: 0
Reputation: 3465
You could try using the document.settings property instead of localStorage. There is a settingsChanged event that might help you do what you're looking for. I've never used it before so let us know if it helps (or not).
The settingsChanged event is only available for Excel as of this post date.
Upvotes: 2