More question on ItemRemove event

  • Thread starter Thread starter Semut
  • Start date Start date
S

Semut

From the help file, it states this event does not run when the last item in
a Personal Folders file (.pst) is deleted, or if 16 or more items are
deleted at once from a .pst file, Microsoft Exchange mailbox, or an Exchange
public folder.

So, anyway or suggestions to overcome the shortcoming of the event?


thank you.
 
Which folder do I have to monitor in order to get events if any folder
is changed or do I have to add every single folder? Now I add
Appointment-, Contact- and Taskfolder, but only subfolders of them are
monitored - can anyone help?

Tanks in advance!
Andreas
 
If you want to monitor folder events you have to set up to separately
monitor each folder for its events (or rather the events on the Items
collection for the folder, there are no folder events). There is no
universal folder change method that would apply to any folder and tell you
in which folder the change occurred.

I'd probably use an Items wrapper collection with a class module defined
that has event handlers for all 3 Items events. Each folder I wanted to
monitor would instantiate an instance of that class, set its Items property
to the Items collection of the folder and declare Items WithEvents so I can
handle the events. Similar to the Inspector wrapper shown at
http://www.slovaktech.com/code_samples.htm#InspectorWrapper
 
Thanks for the tip, but I just want to be notified if the last item from
a folder is deleted (already implemented ItemListener and
ItemsListener). Therefore I read KB Article 279502 and tried to
implement it.

The Problem is, that I get events only from subfolders of Contact-,
Appointment- and Taskfolder. So I wanted to know if it is possible to
monitor kind of a "root-folder" in order to get events from alle folders
to be notified if the last item is deleted.

I hope you can now better understand what my problem is.

regards
Andreas
 
Again, as far as I know you can only monitor specific folders for events and
not all folders and subfolders of those folders in one event handler. A
wrapper collection of some sort that has members for each folder you want to
monitor is the only way I know of to do what you want.
 
Then, you just monitor the parent MAPIFolder instead for such a case.
MAPIFolder.Parent will be useful.
 
Back
Top