Does mapi expose "Remove item from folder" event ?

T

tomer

Hi,

I understand that there is no easy way to detect when an item is deleted
from a folder,
Is it possible to do it using MAPI?
does mapy expose events which outlook doesnot?


thanks in advance.
 
C

Chris Koiak

There's a ItemRemove event associated with the items
collection of every folder (folder.Items.ItemRemove)

Chris
 
K

Ken Slovak - [MVP - Outlook]

But that event doesn't provide the Item that was deleted and also
fires after the item was already deleted. An ItemAdd event handler on
the Deleted Items folder's Items collection would trap all items not
hard deleted (Shift+Delete).
 
D

Dmitry Streblechenko

Yes, when you subscribe to the folder contents table events
(IMAPITable::Advise), you will get a TABLE_ROW_DELETED event which will pass
the value of the PR_INSTANCE_KEY property for that particular row. If you
have cached the other message properties (such as PR_ENTRYID) along with
PR_INSTANCE_KEY, you will be able to match which message had been deleted.

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top