The Office JavaScript API (OfficeJS
) doesn't provide anything for doing that at runtime. But you can specify an equivalent COM add-in in the manifest file to prevent loading your web add-in if a corresponding/specified COM add-in is installed. Here is what MS states for that:
In some cases, your Office add-in may not be able to provide all of the functionality that's available in the corresponding COM add-in. In these situations, your COM add-in may provide a better user experience on Windows than the corresponding Office add-in can provide.
You can configure your Office Add-in so that when the equivalent COM add-in is already installed on a user's computer, Office on Windows runs the COM add-in instead of the Office Add-in. The COM add-in is called "equivalent" because Office will seamlessly transition between the COM add-in and the Office Add-in according to which one is installed a user's computer.
To enable compatibility between your Office Add-in and COM add-in, identify the equivalent COM add-in in the manifest of your Office Add-in. Then Office on Windows will use the COM add-in instead of the Office Add-in, if they're both installed.
The following example shows the portion of the manifest that specifies a COM add-in as an equivalent add-in. The value of the ProgId
element identifies the COM add-in and the EquivalentAddins
element must be positioned immediately before the closing VersionOverrides
tag.
<VersionOverrides>
...
<EquivalentAddins>
<EquivalentAddin>
<ProgId>YourCOMAddinProgID</ProgId>
<Type>COM</Type>
</EquivalentAddin>
</EquivalentAddins>
</VersionOverrides>
Read more about that in the Make your Office Add-in compatible with an existing COM add-in article.