View Single Post
  #4  
Old March 7th 07, 06:05 AM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default (VSTO SE) folder.Items.ItemAdd Event does not fire

No, saving MAPIFolder won't help since you need to keep a reference to the
object raising the evenst, i.e. Items.
If you do not know how many objects you will be referencing, store them in a
list which can have as many items as you want.

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

"Anyone for Coffee?" wrote in
message ...
Thanks for the response Dmitry.

Regarding your comment that parent.Items must be a class level variable. I
assume this is so that it is not garbage collected. I have tried to handle
this by putting the folder in the class-level "m_ItemAddHandled"
collection.
Do you think this does not work?

It is difficult to use parent as a class level variable because I do not
know how many times the SetEventHandler will recurse.



Ads