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.

kushwahav
  • 126
  • 3
  • 1
    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?) – Mavi Domates May 09 '19 at 13:20
  • @MaviDomates By offline deployment I mean that exchange server and outlook clients are connect by LAN network and there is no internet connectivity. – kushwahav May 10 '19 at 06:35

1 Answers1

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.

Mavi Domates
  • 4,262
  • 2
  • 26
  • 45
  • 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. – kushwahav May 10 '19 at 06:47