View Single Post
  #8  
Old October 24th 08, 03:11 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default VBA to delete message after reply

You have to know something to work with Reply. That's an event that fires
when an is replied to. If you want to also handle when someone clicks Reply
All you need to also handle the ReplyAll event.

You already are handling the NewInspector event, so you need to change your
Private m_Mail declaration to a WithEvents declaration. Then when an item is
opened check the Inspector.CurrentItem.Class property for olMail. If it's a
mail item assign m_Mail to that item. You would also do the same in the
Explorer.SelectionChange event if only 1 item is selected and it's a mail
item. To do that you need to declare an Explorers collection object
WithEvents and handle the SelectionChange event.

Then since your mail item object can handle events you handle Reply and
ReplyAll (and Forward if you want).

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


"DKY" wrote in message
news

Would your alternative suggestion of handline the Reply() event be
something that's easily done? I'm not a programmer and found this code
online so if not then I'm at a loss. Appreciate your suggestions.


Ads