Before delete mail item Event Handler

R

RAMS

Hi,
I have used "FolderSwitch","BeforeItemCopy" Event Handlers and got the
events fired in corresponding situations successfully.

But like that I cannot use "ItemEvents_10_BeforeDeleteEventHandler" for
preventing the deletion of certain mails.Whether deletion of mails can be
prevented.Can this be done through code (I am using C#.NET VSTO2005) ?

Regards
RAMS
 
K

Ken Slovak - [MVP - Outlook]

Are you saying the event isn't firing at all, or that setting ref Cancel ==
true doesn't work?

That event will only fire if you are handling events for the item and the
user deletes the open item from the File, Delete menu item. Otherwise it
will not fire. It's not really that useful for that reason.
 
R

RAMS

Hi Ken,

{
explr =app.ActiveExplorer();
}
..
..
{
explr.BeforeItemPaste += new
ExplorerEvents_10_BeforeItemPasteEventHandler(BeforeItemPaste);
}

like this I have used the BeforeItemPaste event handler and got
fired.But like that I cant able to initialize
"explr.BeforeDeleteEvent += new
Microsoft.Office.Interop.Outlook.ItemEvents_10_BeforeDeleteEventHandler(BeforeDelete);".



thanks and regards
RAMS
 
K

Ken Slovak - [MVP - Outlook]

Did you read what I said?

If you look in the Object Browser there is no Explorer.BeforeItemDelete
event, so how could you subscribe to it. That event is only there for
Inspector's.

From my previous post:
 

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