Outlook Addin via JavaScript API: retrieving the categories of items in multi-select mode

19 Views Asked by At

In my Outlook Addin, I would like to retrieve the categories of multiple selected messages. There is an easy to follow setup to list multiple messages' subject line in the official documentation: https://learn.microsoft.com/en-us/office/dev/add-ins/outlook/item-multi-select#retrieve-the-subject-line-of-selected-messages

However, the method used to parse over the multiple items Office.context.mailbox.getSelectedItemsAsync, does not return Outlook items but only a Office.SelectedItemDetails interface (https://learn.microsoft.com/en-us/javascript/api/outlook/office.selecteditemdetails).

Whereas I can easily retrieve an Outlook items categories for the currently selected message, via the method outlined in the documentation, Office.context.mailbox.item.categories.getAsync (https://learn.microsoft.com/en-us/office/dev/add-ins/outlook/categories#get-an-items-categories), this method cannot be used on the multiple items returned by getSelectedItemsAsync.

getSelectedItemsAsync does give me the itemId, and I suspect that I should be able to retrieve either an item from the id, or the categories directly, but I couldn't figure out how. Any help is appreciated.

0

There are 0 best solutions below