I have been running into a blocker while developing an O365 Add-in.
Windows Desktop O365 issue: When opening my Add-in for the first time in a compose setting I have access to the Office.context.mailbox.item, however all inline "Reply" and "Reply All"s have my cached Add-in. For this cached Add-in ItemChanged async events do not have access toOffice.context.mailbox.item unless we wait a moment. I.E. Office.context.mailbox.item is undefined.
So in summary the cached Add-in offers a complex issue. ItemChanged shows when a user changes between emails. However what can I do if I have no access to the item?
I thought I would also mention all pop-out "Reply" and "New message" work as anticipated, and all OWA works with the above logic.
Has anyone else faced this issue, or is there a work around of sorts to reestablish the mailbox item once the Add-in in a compose setting has cached?
Code running in my compose Add-in:
export class BaseModule {
constructor() {}
Office.context.mailbox.addHandlerAsync( Office.EventType.ItemChanged,
(eventType) => { console.log(Office.context.mailbox.item.itemId) }
}
Office.context.mailbox.item(You will receive in the first call) 3. Click "Reply" on a different email 4. RequestOffice.context.mailbox.item(This will be null) - wsoccorsiOffice.context.mailbox.itemis only null for a brief moment in your step 4? If so, then the described behavior is consistent with how Outlook Desktop in Windows behaves.Office.context.mailbox.itemcan be null when you're switching between items, deselected an item or selected an item header. Can you describe what actions you want to take that this issue is preventing you from doing? - Outlook Add-ins Team - MSFT