A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

NewMailEx vs. ItemAdd



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 6th 06, 11:00 AM posted to microsoft.public.outlook.program_vba
Mark Rae
external usenet poster
 
Posts: 6
Default 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


  #2  
Old May 6th 06, 06:30 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default 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


  #3  
Old May 6th 06, 11:11 PM posted to microsoft.public.outlook.program_vba
Mark Rae
external usenet poster
 
Posts: 6
Default 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...


  #4  
Old May 10th 06, 09:27 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default 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...


  #5  
Old May 24th 06, 04:47 PM posted to microsoft.public.outlook.program_vba
tbo
external usenet poster
 
Posts: 10
Default 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?
  #6  
Old May 24th 06, 06:33 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default 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?


  #7  
Old May 25th 06, 08:01 AM posted to microsoft.public.outlook.program_vba
tbo
external usenet poster
 
Posts: 10
Default 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?
  #8  
Old May 25th 06, 03:06 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default 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?


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ItemAdd BlockNinja Outlook and VBA 1 March 23rd 06 04:49 AM


All times are GMT +1. The time now is 12:22 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-2025 Outlook Banter.
The comments are property of their posters.