[Outlook VSTO] - ActiveExplorer.SelectionChange running multiple times. RRS feed

  • Question

  • Hello,

    As the title says, we have an Outlook VSTO that uses the active explorer and displays a task pane based on the current selected item. 

    We encountered a problem that when the User is searching for an email, after they search the results will be display and they can select an email. Once they selected an email SelectionChange will run and based on the email a task pane will show. The problem is SelectionChange running a couple of times (more than 5 times) after they select an email. It only happens when the user is searching an email and it doesnt happen when the user is selecting from an inbox.

    I was hoping someone can help us with how the SelectionChange is running multiple times when selecting an item after searching.


    Thursday, December 3, 2020 7:38 AM

All replies

  • You can cache the value of the EntryID property and check if the same item is selected to avoid repeatedly running your code against the same item,.

    Dmitry Streblechenko (MVP)
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Thursday, December 3, 2020 3:16 PM
  • Hello Dmitry,

    Thanks for the reply.

    We already have a check for the Entry ID. But that doesnt change the fact that it still runs multiple times. Is there a solution for this? Because it doesnt only run for two or 3 times, it runs for more that 5 times.


    Friday, December 4, 2020 12:01 PM