Programmatic hook into Get Mail event?

B

Ben M

Hi,
I was just wondering whether anyone knew whether there was a programmatic
hook into the event of Outlook getting mail. Is there something that fires
when this happens? I want to be able to fire off some methods of my own when
this happens.

I know there is the Application.NewMail event, but this only fires when
there is actually new mail (doesn't it?).

I looked at the SyncObjects collection also. I thought this might have
something to do with it, but I couldn't be sure.

Thanks for any help,
Ben
 
K

Ken Slovak - [MVP - Outlook]

NewMail fires when new mail comes in but doesn't give you a handle to the
items that arrived and it only fires at intervals. ItemAdd on the Inbox
folder's Items collection will give you a handle to the incoming item and as
long as not more than 15 items come in at once and your event handler code
doesn't take too long will fire for every item that arrives.

SyncObjects will only be relevant if you are manually sending/receiving with
a send/receive group, doesn't apply to earlier versions of Outlook and will
only tell you that the synch is complete.
 
B

Ben M

Thanks Ken,
So there's no event which fires just when checking mail, only when there is
new mail?
Cheers,
Ben
 

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