Search code examples
office-jsoffice-addinsword-addins

Word Addin: Is there a way to dynamically load the XML Manifest?


I have a Word Add-in project running on my local server (e.g. http://mylocal:1234/addin) and a similar Word Add-in running on a remote server (e.g. http://myremote.azurewebsites.net/addin).

When I open from my local browser a Word document stored on the remote server, the Word Add-in loaded is my local's Add-in, but I would like to load the remote one.

So, I would like to load dynamically the Add-in situated in the same server of the document (whose location I could get from Office.context.document.url). Is there a way to achieve this behavior? I do not want to create different manifests.

This is my current Manifest's Source Location:

<DefaultSettings>
  <SourceLocation DefaultValue="~remoteAppUrl/Home.html" />
</DefaultSettings>

Solution

  • What you are asking for cannot be done. Any given manifest can have only one SourceLocation. You will need two manifests (with different <ID> values).