Outlook new mail? Only want to look at new mail. how?

R

Roger

I have a process set up to monitor the Outlook.newMail event.

This seems to be working great.

The problem I have is when this event is fired how do I know how many
e-mails I just received.

I would love to just look at the "New" e-mails and not all of the e-mails in
the inbox?

Currenly I am just looking at the Top or First e-mail, but that doesn't work
when
I get multiple e-mails.

Is there a way to just get the collection of "New" e-mails?

Or is there another way to do this?

Thanks,

Rog
 
S

Sue Mosher [MVP-Outlook]

The NewMail event doesn't provide that kind of information. You could maintain a record of the time of the last NewMail event and search the Inbox for all items received since that date/time. The more common approach is to use the MAPIFolder.Items.ItemAdd event, which has its own limitation -- it doesn't fire if more than 16 items arrive at the same time.

FYI, there is a newsgroup specifically for general Outlook programming issues "down the hall" at microsoft.public.outlook.program_vba or, via web interface, at http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public.outlook.program_vba. This group is for application interoperability issues, not COM interop.
 

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