OfficeJS Add-In - Communicate with external local native application

Dominik Hölzl 21 Reputation points
2021-01-18T09:20:36.433+00:00

Hello!

I have a question about OfficeJS Add-Ins and how to communicate with a native application running locally on the client.

How to do this (in a future proof way) when the add-in is running in a native Office client? Is there any API for this?

When running the add-in in the web browser, the web browser's WebExtension technology can be used (native messaging, ...) by the add-in to access the local client, but unfortunately when running in a native Office client, neither WebExtensions nor the legacy Plug-Ins (ActiveX in IE, NPAPI in the WebView control on macOS) are enabled/available.

One way to communicate would be using a web socket connection to 127.0.0.1, as far as I know browsers (and probably the used browser controls used by the native Office application?) currently do not prohibit this, but they probably could do this in future. The old Microsoft Edge browser ("Spartan") only allowed such connections when enabled in the registry, but modifying the registry to enable such access should be avoided.

One possible "workaround" for this could be using a public DNS entry pointing to 127.0.0.1 to connect to which would work around such restrictions, but this can conflict with local proxy settings (when the proxy settings include the used DNS to be routed over the proxy, no connection to the local client is possible).

Another possibility (and currently probably the only future proof way) would be communicating with the local client through an external web server, where both the JS-add-in and the local client have web socket connections to. This would be the most complex and cumbersome solution which I want to avoid if possible.

The ideal solution would be that the native Office application would support the browser's WebExtensions and native messaging, as this is a modern uniform way of communication, is there any development into this direction?

Any thoughts?
Thank you and regards,
Dominik

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,583 questions
0 comments No comments
{count} votes