Office-js: Using Office.onReady() Breaks Outlook 2013 add-ins

Created on 19 Nov 2018  路  4Comments  路  Source: OfficeDev/office-js

Our Outlook add-in has stopped working in Outlook 2013 after changing the entry point to onReady. The problem appears to be that the HostType we receive in the info parameter is coming back as Excel. The follow-on to this is that many of the API's under Office.context (e.g. diagnostics, roamingSettings, mailbox) are undefined.

Expected Behavior

We should be receiving Outlook as the HostType, and the relevant api's should be defined and available.

Current Behavior

Excel is reported, and the calls to Outlook specific functions, as well as diagnostics and roamingSettings are unavailable.

Steps to Reproduce

  • Set entry point via onReady(info)
  • Load add-in in Outlook 2013
  • Read info.host, observe Excel instead of Outlook
  • Observe that Office.context.mailbox, Office.context.diagnostics and Office.context.roamingSettings are undefined.

  • Additional details:

    1. The behaviour of our Add-in in Outlook 2013, in a lot of ways mirrors what happens when you attempt to load it directly in a browser (without Outlook, navigating directly to one of the web pages).

    2. Previously we had been using sessionStorage.getItem('hostInfoValue') to determine the platform. We recently found this did not work on all platforms, and so moved from Office.initialize to Office.onReady(info). This is when we started seeing this issue.

    3. Following on from finding this issue, I've been able to get the add-in working again Office.initialize and querying Office.context.diagnostics.

Context

We made the change to OnReady to simplify platform detection. We had been using the undocumented sessionStorage.getItem('hostInfoValue') to determine this, but ran into a case where it did not work.

Your Environment

  • Platform [PC desktop, Mac, iOS, Office Online]: We've tested on Windows and Mac, Outlook 2016 and Office Online all work. Outlook 2013 does not.
  • Host [Excel, Word, PowerPoint, etc.]: Outlook
  • Office version number: 15.0.5085.1000
  • Operating System: Windows 10

Useful logs

  • Due to this being exclusively an issue on Outlook 2013, console logs are unavailable.
  • Given the nature of the issue, screenshots would not prove useful.
fix pending product bug

Most helpful comment

This is now a known issue, we have a fix and will soon rollout. thanks for reporting! We are tracking with 2572847 internally.

All 4 comments

Thanks for reporting this, @Alturos . We're looking into it and will follow up.

This is now a known issue, we have a fix and will soon rollout. thanks for reporting! We are tracking with 2572847 internally.

Closing issue, as the fix for this has been deployed.

I want to know where is the deployed fix? Is it there 'https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js'?
When my office addin app use the this 'https://appsforoffice.microsoft.com/lib/1/hosted/office.js' in outlook 2013 standard version, I still get the object 'Office' is undefined error.

Was this page helpful?
0 / 5 - 0 ratings