ItemChanged event not triggered sometimes on change thread list email

WAL Development Team 0 Reputation points
2025-08-28T13:49:25.08+00:00

Hi Team,

I’m building an Outlook add-in using Office.js, and I’ve run into an issue with the Office.EventType.ItemChanged event.

The event doesn’t always fire when I expect it to:

  • If I switch between two completely different emails (different threads), it works fine.

But if I switch between emails in the same conversation/thread, sometimes the event does not trigger at all.

Because of this, my add-in UI doesn’t refresh to show the correct data for the newly selected message. Right now I’m forced to add a polling workaround that checks Office.context.mailbox.item.itemId every few seconds to detect the change, but this feels like a hack and isn’t efficient.

Expected: ItemChanged should always fire whenever the selected message changes, even if it’s another message in the same conversation/thread.

Actual: The event sometimes doesn’t fire when navigating within a thread.
Trigger code:

Office.context.mailbox.addHandlerAsync(Office.EventType.ItemChanged, getQuoteDetailByMessageId);

Environment:

  • Outlook Web
  • Office.js version: [
      "office-addin-sso": "^2.3.3"
    
    ]

Steps to reproduce:

Select an email in Outlook.

Switch to another email from the same conversation/thread.

Notice that ItemChanged doesn’t always fire.

This is blocking for us because our add-in depends on knowing when the selected item changes.

Thanks for looking into this!

Outlook | Web | Outlook.com | Email
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sin-D 1,765 Reputation points Microsoft External Staff Moderator
    2025-08-29T04:45:56.0566667+00:00

    Hello WAL Development Team,

    Thank you for reporting this. The behavior you’re seeing is expected in some scenarios because of how Outlook optimizes conversation view and handles add-in lifecycle events. When you switch between messages in the same conversation, Outlook often reuses the reading pane context for performance. This means the ItemChanged event may not fire because the host doesn’t consider it a full context change. For certain item types (encrypted mail, calendar invites), the add-in may reload entirely instead of raising ItemChanged.

    Make sure your UI refresh logic runs on add-in initialization (using Office.onReady() or Office.initialize()) as well as in the ItemChanged handler. This covers cases where the add-in reloads or the event doesn’t fire.

    Check if SelectedItemsChanged fits your scenario If you’re on Mailbox API 1.13 or later, this event can help in some cases where ItemChanged falls short, especially in OWA or New Outlook. Use Office.context.roamingSettings or similar to keep track of the last processed item so your add-in can restore the correct view after a reload.

    There're some similar cases related to ItemChanged, please check out:

    If you think this problem come from our developer team, please hesitate out in Office Dev Issues or Microsoft 365 Developer Platform

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. 

    Best regards,

    Sin Dau

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.