0

I'm currently facing an issue with Outlook object model of the API in all versions from v1.1 and higher on Mac Outlook 2016 (V16.15.0 and up). The method Office.context.mailbox.displayMessageForm is not working on Outlook for Mac. On Windows as well as on the online versions everything is working fine.

Current situation: I wrote an outlook add-in which creates a new draft of an email (saved in draft folder via usage of EWS envelope) and opens the new draft by using the outlook add-in API (method: Office.context.mailbox.displayMessageForm - https://learn.microsoft.com/de-de/office/dev/add-ins/reference/objectmodel/requirement-set-1.5/office.context.mailbox#displaymessageformitemid). The add-in is working fine in Outlook on the web (old version as well as the new version in office 365) in Chrome, Firefox, IE, Edge and Safari independently of the browser versions. Outlook 2016 in the latest builds on Windows 10 is also working fine. Unfortunately, under Outlook 2016 for Mac the add-in is unable to open the message window. No error occurs. However, the draft was successfully created. The problem exists since nearly 6 months and I wasn't able to finde the root cause due to the limited Outlook for Mac troubleshooting functionalities.

The add-in is publicly available via MS AppSource (https://appsource.microsoft.com/de-de/product/office/WA104381616?tab=Reviews). Unfortunately, I'm because of the described issue not able to publish a new version. Microsoft support isn't helpful.

If there are further questions, just comment. Every help or hints are very much appreciated. Thanks in advance for your support! Thomas

1 Answers1

0

displayMessageForm() API is not working on Outlook for Mac, because the Outlook client does not know about the new message yet.

enter image description here

Basically the issue is because your add-in tries to access the item, but the item is not yet synced to the client. Adding some delay before calling displayMessageForm should fix your issue.

SureshGowtham S
  • 686
  • 5
  • 10
  • Thanks for the detailed explanation @SurehGowtham! I'll try if a delay would solve the problem but honestly this is no real solution for me because the delay will significantly impact all implementations and not only Mac (I don't think there's a way to figure out which platform runs the script). Furthermore, a hard coded delay will lead to a very fragile solution. Do you have an idea how to check if the message is already available on the client? (displayMessageForm doesn't return an error if message is unavailable) – Thomas Shepherd Apr 02 '19 at 08:22
  • Agreed, but I don't think there is a proper solution for this issue. But to scope it down to Mac, you can use [Office.context.platform](https://learn.microsoft.com/en-us/javascript/api/office/office.context?view=office-js#platform) – SureshGowtham S Apr 02 '19 at 12:20
  • @ThomasShepherd You can try using [displayReplyAllForm](https://learn.microsoft.com/en-us/office/dev/add-ins/reference/objectmodel/requirement-set-1.7/office.context.mailbox.item#displayreplyallformformdata-callback) / [displayReplyForm](https://learn.microsoft.com/en-us/office/dev/add-ins/reference/objectmodel/requirement-set-1.7/office.context.mailbox.item#displayreplyformformdata-callback) / [displayNewMessageForm](https://learn.microsoft.com/en-us/office/dev/add-ins/reference/objectmodel/requirement-set-1.7/office.context.mailbox#displaynewmessageformparameters) to solve your issue – SureshGowtham S Apr 04 '19 at 02:51
  • Thanks for your help and the suggestion with displayReplyForm (I already thought about this but it brings in more difficulties). Unfortunately, the delay doesn't solve the problem. I made some further investigations on Mac and the behaviour some months ago slightly changed (some months ago the draft has been created but not opened) and the EWS requests are now not send or at least not visible in the OfficeWebAddinDeveloperExtras network console. I'll dig deeper into details the next days and keep you posted. – Thomas Shepherd Apr 07 '19 at 23:40
  • I just found this: https://stackoverflow.com/questions/53073456/ews-request-not-responding-with-error-on-mac - it seems like EWS requests are currently not working under Mac 16.23. – Thomas Shepherd Apr 07 '19 at 23:46
  • With 16.26 EWS is now working again and your workaround is also working! Unfortunately, your workaraound only works if the function is triggered via Taskpane. If the function is UI-less, the window does not open. Do you have any idea why? – Thomas Shepherd Jun 06 '19 at 22:07