Re: Outlook events
- From: "Ken Slovak - [MVP - Outlook]" <kenslovak@xxxxxxxx>
- Date: Wed, 21 Jun 2006 09:15:22 -0400
Most likely because the event handler is out of scope or has been garbage collected by the time the event fires. A private variable that remains in scope would prevent that.
It's the same case if you need to track multiple Inspectors or Explorers and handle a button click separately in each one. The event might fire the first time but to ensure it always remains available as long as that Inspector or Explorer is open you do something like putting the object reference in a hashtable or dictionary or collection.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
"Paulo Braz Figueiredo" <paulo.braz.figueiredo@xxxxxxxxx> wrote in message news:2649205F-30E1-43DB-B0AE-A4E3236154D8@xxxxxxxxxxxxxxxx
Hi Ken Slovak,
you have reason. I tried without the private member and it doesn’t woks. I
have my problem resolved but I don’t understand the importance of the private
member!
I’m doing:
this.reminders = this.Reminders;
reminders.ReminderFire += new
Microsoft.Office.Interop.Outlook.ReminderCollectionEvents_ReminderFireEventHandler(Reminders_ReminderFire);
Where reminders is a private member.
But if I do:
this.Reminders.ReminderFire += new
Microsoft.Office.Interop.Outlook.ReminderCollectionEvents_ReminderFireEventHandler(Reminders_ReminderFire);
It doesn’t work! And I do not understand why!
Thanks for the help on this subjet.
--
Paulo Figueiredo
.
- References:
- Re: Outlook events
- From: Ken Slovak - [MVP - Outlook]
- Re: Outlook events
- From: Ken Slovak - [MVP - Outlook]
- Re: Outlook events
- From: Ken Slovak - [MVP - Outlook]
- Re: Outlook events
- From: Paulo Braz Figueiredo
- Re: Outlook events
- Prev by Date: Re: Outlook events
- Next by Date: RE: Word Add-In does not work correctly
- Previous by thread: Re: Outlook events
- Next by thread: How to find out which application is launched on click of button in the office toolbar
- Index(es):