create confirmation email in vba when email received

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

Guest

I would like to send a message confirmation for every
email that my mail box (set up an admin box) receives. I
tried to set this up as an autoreply, but then it only
gets sent once and the mailbox has to be open.

Is there a way to have vba code run every time (at the
point in time when) an email is received? That way I can
create and send the email through vba code.

Any ideas? Thanks.
 
For started, Outlook will always have to be running anyway to fire the VBA
code.

The ItemAdd event for a MAPIFolder object's Items collection (such as your
Inbox) fires every time a new item is put into the folder, including when
new e-mails are sent to your delivery location (the Inbox again). Get the
MAPIFolder object for your Inbox, and set a global Items variable declared
WithEvents from the MAPIFolder.Items property. You can get the ItemAdd
event from that.
 
Back
Top