Reputation: 151
I am working on word Addin. My host application is one asp.net website from which I shall open word document and word addin will sideload there. My requirement is after I open document I should be able to read all the sections in the document and then pass the section names in host application and open a new tab/popup in the host application with the data I have read.
I am able to read sections and I can open a pop up using dialog api but I want to pass the context and data to host website instead of opening a stand alone popup using dialog api.
Is there any way we can pass data and context from word document to host application using office js?
Upvotes: 1
Views: 476
Reputation: 9784
You can pass any information you want from add-in to another web application if it exposes a web API, so the answer to "from the AddIn can we pass context to the application from which we are opening word" is yes.
To pass information to the add-in from what you are calling the host web application, I think you have two options.
Have logic in the add-in, that runs as soon as it has loaded, that calls out to the web app to fetch the context data.
The web app uses the Open XML SDK 2.5 for Office to add context information, as custom XML parts or custom properties, to the document before it opens the document for the user. Have logic in the add-in, that runs as soon as it has loaded, that reads this custom XML or custom properties.
Upvotes: 1