Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Outlook-addin not working with offline office.js downloaded from GitHub

Outlook add-in using offline office.js library downloaded form GitHub is not working when internet is blocked. Office.js library is hosted on a local server.

<script type="text/javascript" src="/node_modules/@microsoft/office-js/dist/office.js"></script>

Outlook client version: 16.0.4738.1000 32-bit
GitHub office-js library version: 1.1.11

When add-in is accessed, error messages are prompted in pop-up.

Error: Object doesn't support property or method 'registerEnum'   
URL:
https://localhost/node_modules/@microsoft/office-js/dist/outlook-15.04.js

and

Error: Unable to get property 'read' of undefined or null reference   
URL:
https://localhost/node_modules/@microsoft/office-js/dist/o15apptofilemappingtable.js

Analyzing network calls shows that this library internally invokes other online libraries. One such library is https://ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js

Is there any way that this library can be used offline for deployments where internet access is blocked?

Note: When internet is enabled then Outlook add-in using this library works fine.

like image 662
kushwahav Avatar asked May 09 '19 05:05

kushwahav


1 Answers

The short answer to whether you can use these add-ins in local-mode is yes, you can. Some Outlook add-in APIs might invoke EWS APIs which would fail in the no-internet mode, but some stuff would work. I'm not convinced this is a good idea though, because you can't really develop, distribute, update the app in a similar way compared to if it was living on a server.

Regarding why your add-in is failing on local, see this question: MicrosoftAjax.js is not loaded successfully inside Office application

Please copy all of the dist folder's contents recursively.

like image 148
Mavi Domates Avatar answered Sep 21 '22 14:09

Mavi Domates