create confirmation email in vba when email received

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

Eric Legault [Outlook MVP]

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.
 

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