Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Forms / March 2008

Tip: Looking for answers? Try searching our database.

Before delete mail item Event Handler

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
RAMS - 29 Feb 2008 13:04 GMT
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
Ken Slovak - [MVP - Outlook] - 29 Feb 2008 13:59 GMT
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.

Signature

Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm

> Hi,
>    I have used "FolderSwitch","BeforeItemCopy" Event Handlers and got the
[quoted text clipped - 6 lines]
> Regards
> RAMS
RAMS - 03 Mar 2008 05:28 GMT
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

> Are you saying the event isn't firing at all, or that setting ref Cancel ==
> true doesn't work?
[quoted text clipped - 13 lines]
> > Regards
> > RAMS
Ken Slovak - [MVP - Outlook] - 03 Mar 2008 13:38 GMT
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:

>> 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.

Signature

Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm

> Hi Ken,
>
[quoted text clipped - 15 lines]
> thanks and regards
> RAMS
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.