Search code examples
office-jsoutlook-web-addins

Office.js Exchange On-Prem 2013 mailbox.item saveAsync


I am developing an application for an organisation that is using Exchange 2013 on-premise and wants a 'simple' Outlook add-in that can be used to add some message headers to the message when the user clicks a button in compose mode.

Given the age of this, the only requirement set I have access to is 1.1 which is complicating matters.

I have managed to use makeEwsRequestAsync along with some handcrafted SOAP to set InternetHeaders on the message but this requires me to call Office.context.mailbox.item.saveAsync() to get an EWS ID and thanks to some dubious documentation on the MS site where the show the method being used in the 1.1 req set documentation, it turns out this method is only available in 1.3+.

Does anyone know of either a SOAP request I can craft by hand to send up to get the message saved as a draft and its itemId returned to me or perhaps getting something similar to saveAsync working in the 1.1 req set.


Edit 1: I did try using the Custom Properties interface before making manual EWS calls but these don't seem to be sent with the message when the user finally clicks send so those were discarded.


Solution

  • Sorry, that's an error in the documentation. Thanks for reporting, we'll fix it. item.itemId can only be used in read mode until 1.2 API set (and in compose mode when the item is already saved).

    The only way to get the itemId for an email in compose mode is to use saveAsync(), so you will have to move to the 1.3 requirement set in order to set internet headers.