Sounds like the classic "object goes out of scope and get's garbage
collected" issue.
Make sure whenever you bind to events in any .NET application (but
especially COM interop scenarios like Office) that the object remains rooted
for as long as you intend to handle the event. Otherwise the garbage
collector will pick it up and discard it.
The problem is worse in COM interop scenarios because even though the real
object might still be alive (like the Outlook Application object) it's
runtime callable wrapper (RCW) is created on the fly and thrown away when it
goes out of scope. You can hang onto the RCW in a static field or instance
field if need be.
--
Josh Einstein / Tablet PC MVP
Einstein Technologies, LLC
-----------------------------------------------------
Tablet Enhancements for Outlook 3.0 Now Available
Unleash the potential of Outlook on your Tablet PC, Origami, or UMPC.
Try it for 15 days -
http://www.tabletoutlook.com/Go.ashx?id=ng
wrote in message
ups.com...
Hello all,
I am writing an outlook plugin for saving emails I send and receive.
For some reason, after a while, the ItemSent event stops and the
delegate doesn't get called when emails are sent.
Any ideas why does that happen? What could be done to prevent it from
happening?
Thanks in advance,
Nool