Intercepting ItemEvents

D

darshan tilak

I got a simple com addin for otulook working.
I need help me regarding how to intercept the ItemEvents : Add or
BeforeDelete.
I am aware of how to catch ApplicationEvents, but nowhere have i found an
example for ItemEvents.

A code example would be great....
 
K

Ken Slovak - [MVP - Outlook]

BeforeDelete only fires if the item is opened and you delete the item from
its File menu. Otherwise you won't ever get that event.

ItemAdd is an event of the Items collection of a MAPIFolder object. Since
you don't mention your language platform here's a sample in VBA.

Dim WithEvents colItems As Outlook.Items

' set colItems to the Items collection of the folder of interest. Then you
can handle the add event:

Private Sub colItems_ItemAdd(ByVal Item As Object)
 

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