SelectionChange Event stops firing

  • Thread starter Thread starter Omar Shahine
  • Start date Start date
O

Omar Shahine

I have an Outlook Addin in C# running against 2003 and have an
interesting problem.

I register for this event:

Application.ActiveExplorer().SelectionChange +=new
ExplorerEvents_10_SelectionChangeEventHandler(OnSelectionChange);

and it works fine until I use any .NET addin (be it mine or NewsGator
etc) that displays a Windows Forms (like a dialog) or an
OpenFolderDialog etc. On the second occurence of the dialog appearing
the event stops firing till I quit and relaunch Outlook.

Any ideas?

-Omar
 
Store Application.ActiveExplorer as a class member to keep it referenced at
all times:

m_Explorer = Application.ActiveExplorer();
m_Explorer.SelectionChange +=new
ExplorerEvents_10_SelectionChangeEventHandler(OnSelectionChange);


Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Sorry if I wasn't clear. Application for me is a static variable.
However, I changed to using a private member variable with the same
results. Event stops working.
 
I did not mean Application, but Explorer. Doesn't really matter how you
store it as long as it is explicitly referenced at all times.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Back
Top