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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With