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

1

6

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.

Lefton answered 9/5, 2019 at 5:22 Comment(2)
Just to understand this when you say offline for deployments, are you referring to local machines running the server? (Connecting to the add-in from localhost?)Tardigrade
@MaviDomates By offline deployment I mean that exchange server and outlook clients are connect by LAN network and there is no internet connectivity.Lefton
T
1

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.

Tardigrade answered 9/5, 2019 at 13:30 Comment(1)
I have already copied dist folder's contents recursively. The solution mentioned in the link won't work in this scenario as accessing any library using CDN is blocked.Lefton

© 2022 - 2024 — McMap. All rights reserved.