Integrating Office.js with Mendix

How can we integrate Office.js with mendix.
1 answers

If all you need to do is develop a plug in that sends data to Mendix as a service (no Mendix UI needed), then you can accomplish this with a REST call using AJAX (or equivalent) in your plugin page.  For example, I have done this with an Outlook plugin that uses office.js to retrieve the message and attachment Ids, then posting to a Mendix REST service.  Then use microflows to retrieve the attachment bytes via GraphAPI to create Mendix documents.


Or are you asking about using a mendix app embedded within the popup/sidebar in an Office app?

O365 widgets are redirects to web pages, so theoretically, I think you can accomplish this.  You would set your manifest.xml to redirect to a Mendix page.

It depends on what you want to integrate.  For example, you could probably redirect to a Mendix page using deeplinks with a microflow to retrieve data based off of the url.

If you are looking to do document manipulation from a Mendix sidebar, it may be easier to use the Graph API within Mendix to modify your object rather than directly from office.js.  Pass in the reference id using deeplink.  Then have microflows that call out to Graph to modify or retrieve associated data.


Alternatively, you also may be able to transfer data using the browser LocalStorage/SessionStorage.  Your sidebar page could contain an iframe to a mendix app.  In that page, you run your office.js javascript and pass data between using sessionStorage.  On the Mendix side, you would need custom widgets/nanoflows.


If you are running desktop Office apps, keep in mind I think they are still running IE internally for office.js plugins.  At least, Office2016 still is.