New email event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I can not find out how to capture new email in the Inbox event with VBA. I
need it to automatically handle voting buttons responses. I want to put these
emails in to the separete folder. Please let me know if somebody has a
solution or idea. Thanks.
 
Just to give more background info.
I used the rule to move it to another folder but altimate goal is to update
excel spreadsheet with Yes or No reply from the voting. Application generates
emails for about 1000 users listed in excel.
 
You have to create a hook to the folder that you want to monitor when the
Application_Startup event fires, then use the ItemAdd event to get a handle
to a MailItem object, and finally use the MailItem.VotingResponse property to
get the data.

This article has a great example:

How to create a custom rule using Visual Basic for Applications (VBA) in
Outlook 2002:
http://support.microsoft.com/default.aspx?scid=kb;en-us;292063

Keep in mind that the ItemAdd event is not guaranteed to fire if a large
number of items are added/delivered to the folder at the same time.
 
Back
Top