Hooking events for new items in a mail folder

M

mika

I need to create folder "Test Folder" and catch all events about changing
count of item in this folder. I wrote folowing code:

MSOutlook.MAPIFolder root = Utility.Folder.GetRootFolder(this.Session);

MSOutlook.MAPIFolder testFolder = Utility.Folder.CreateFolder(root, "Test
Folder");

testFolder.Items.ItemAdd += new delegate { MessageBox.Show("This is never
displayed!!!") };

Then I launch Outlook and see my created folder. Try to drag from Inbox some
mail and drop into my folder, but nothing changed. What's I'm doing incorrect?
 

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