none
Showing a prompt in Expl_SelectionChange event prevents reading pane content from being updated RRS feed

  • Question

  • In the Explorer SelectionChange event we are displaying a prompt to the user. When this prompt is displayed, the content on the Reading Pane is still the content of the previously selected email. Unless you click OK on the prompt to close it and the code execution of SelectionChange event finishes, the currently selected emails content will not be displayed on the Reading Pane. 

    In Outlook 2010, we managed to solve this by placing a Application.DoEvents() in the Explorer_SelectionChange event but this does not work in Outlook 2007. 

    In Outlook 2007, in Explorer_SelectionChange event, how can we display a modal prompt to the user such that the currently selected emails content is displayed in the Reading Pane? Or is there a method that we can call to refresh the Reading Pane content?

    Thank you.


    Anand Kumar

    Wednesday, June 13, 2012 5:02 AM

Answers

  • Try to fire a timer in the SelectionChange event, then when the timer fires (it is out of the SelectionChange event handler), disable the timer and disply the message box.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.3 is now available!

    • Marked as answer by a3kumarz Wednesday, June 13, 2012 11:47 PM
    Wednesday, June 13, 2012 5:41 AM

All replies

  • Try to fire a timer in the SelectionChange event, then when the timer fires (it is out of the SelectionChange event handler), disable the timer and disply the message box.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.3 is now available!

    • Marked as answer by a3kumarz Wednesday, June 13, 2012 11:47 PM
    Wednesday, June 13, 2012 5:41 AM
  • you can also use WinFormsSynchronizationContext and use Post method (which will send message to window message queue and invoke your method after event has ended)
    Wednesday, June 13, 2012 7:08 AM
  • To start a timer in the SelectionChange event, worked nicely in my situation.

    Thanks Dmitry.


    Anand Kumar

    Wednesday, June 13, 2012 11:46 PM