Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   NewMailEx vs. ItemAdd (http://www.outlookbanter.com/outlook-vba/13919-newmailex-vs-itemadd.html)

Mark Rae May 6th 06 11:00 AM

NewMailEx vs. ItemAdd
 
Hi,

I'm trying to use Outlook 2003's Application_NewMailEx event to copy all
incoming messages into various folders etc.

I've pretty much lifted the code directly from he
http://msdn.microsoft.com/library/de...hatsNew2k3.asp

The actual mechanism certainly works, but intermittently it won't pick up
one or more of the incoming messages.

E.g. if there is only one incoming message, then it works perfectly.
However, if there are quite a few, as is common when I launch Outlook first
thing in the morning and there could be up to 50 new emails, then typically
this event seems to process only about 80% of them at random.

Is this a known issue? Would I be better off using the ItemAdd event
instead?

Any assistance gratefully received.

Mark



Ken Slovak - [MVP - Outlook] May 6th 06 06:30 PM

NewMailEx vs. ItemAdd
 
Both events will fail at around 16 or more items coming in at the same time.
It's a known thing due to the underlying MAPI notification limitations and
there are no real workarounds other than scanning the Inbox at intervals to
sweep items that might have been missed.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Mark Rae" wrote in message
...
Hi,

I'm trying to use Outlook 2003's Application_NewMailEx event to copy all
incoming messages into various folders etc.

I've pretty much lifted the code directly from he
http://msdn.microsoft.com/library/de...hatsNew2k3.asp

The actual mechanism certainly works, but intermittently it won't pick up
one or more of the incoming messages.

E.g. if there is only one incoming message, then it works perfectly.
However, if there are quite a few, as is common when I launch Outlook
first thing in the morning and there could be up to 50 new emails, then
typically this event seems to process only about 80% of them at random.

Is this a known issue? Would I be better off using the ItemAdd event
instead?

Any assistance gratefully received.

Mark



Mark Rae May 6th 06 11:11 PM

NewMailEx vs. ItemAdd
 
"Ken Slovak - [MVP - Outlook]" wrote in message
...

Both events will fail at around 16 or more items coming in at the same
time. It's a known thing due to the underlying MAPI notification
limitations


I see...

there are no real workarounds other than scanning the Inbox at intervals
to sweep items that might have been missed.


What's the most efficient way of doing that? By that, I mean that scanning
the Inbox is simple enough, but how do you remember which MailItem objects
in the Inbox have been processed from one sweep to the next? I don't really
want any sort of database functionality here...



Ken Slovak - [MVP - Outlook] May 10th 06 09:27 PM

NewMailEx vs. ItemAdd
 
Set a user property on items you've processed.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Mark Rae" wrote in message
...
"Ken Slovak - [MVP - Outlook]" wrote in message
...

Both events will fail at around 16 or more items coming in at the same
time. It's a known thing due to the underlying MAPI notification
limitations


I see...

there are no real workarounds other than scanning the Inbox at intervals
to sweep items that might have been missed.


What's the most efficient way of doing that? By that, I mean that scanning
the Inbox is simple enough, but how do you remember which MailItem objects
in the Inbox have been processed from one sweep to the next? I don't
really want any sort of database functionality here...



tbo May 24th 06 04:47 PM

NewMailEx vs. ItemAdd
 
Hi

I've tried it with just 2 new emails (not 16) but event was raised just for
the second.
I think that this event raised only once per "Send/Recieve All" action.

Is this correct?

Ken Slovak - [MVP - Outlook] May 24th 06 06:33 PM

NewMailEx vs. ItemAdd
 
Well, yes but so what? You get a string that is a collection of the
EntryID's of every email that came in during that operation, separated by
commas. So if you split the string on commas your array should hold the id's
of every item that came in.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"tbo" wrote in message
...
Hi

I've tried it with just 2 new emails (not 16) but event was raised just
for
the second.
I think that this event raised only once per "Send/Recieve All" action.

Is this correct?



tbo May 25th 06 08:01 AM

NewMailEx vs. ItemAdd
 
If I had a comma separated string with the EntryID's I would be very pleased.
But, I'm taking just one EntryID. The EntryID of the most recent email.

Am I missing something?

Ken Slovak - [MVP - Outlook] May 25th 06 03:06 PM

NewMailEx vs. ItemAdd
 
I guess so, if more than 1 email comes in and you only get one EntryID.

I myself never use NewMailEx, I always use ItemAdd.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"tbo" wrote in message
...
If I had a comma separated string with the EntryID's I would be very
pleased.
But, I'm taking just one EntryID. The EntryID of the most recent email.

Am I missing something?



tbo May 25th 06 04:30 PM

NewMailEx vs. ItemAdd
 
Which class has the ItemAdd event?

Ken Slovak - [MVP - Outlook] May 25th 06 07:08 PM

NewMailEx vs. ItemAdd
 
Items.ItemAdd

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"tbo" wrote in message
...
Which class has the ItemAdd event?




All times are GMT +1. The time now is 07:37 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com