BeforeDelete Event

J

James Winton

Outlook(2002)
I have written a custom message form to require Client
coding on all outbound e-mail. It allows the user to
lookup the client no from our Practice Mgmt system.

Now, I want to require coding on all inbound e-mails. I
have the BeforeDelete method on an item, but I cannot
figure out how to caputure the delete event if they delete
if from the explorer.

if they open the item and hit delete the BeforeDelete
event fires. If they delete it from explorer it doesn't.

I want to inspect the message to ensure it has the client
code on it, if not I want to prompt the user to enter the
client code or an override code prior to deleting the item.
Any help would be appreciated.
 
K

Ken Slovak - [MVP - Outlook]

As you saw, that event only fires when the item is deleted when in an
open Inspector. For deletions in an Explorer you'd have to use the
ItemRemove event on the Items collection of the folder. That doesn't
fire before the delete and doesn't tell you which item was deleted.
You can use ItemAdd on the Items collection of the Deleted Items
folder but that won't fire if the item was hard deleted using
Shift+Delete. Those are your choices.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm
 

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