![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
When using NewMailEx to get a list of received e-mails, EntryIDCollection
will only return the very first e-mail received, even if 10-15 e-mails come in at the same time. This is my code in it's entirety. Private Sub Application_NewMailEx(ByVal EntryIDCollection As String) Dim arr() As String Dim i As Integer Dim m As MailItem On Error Resume Next arr = Split(EntryIDCollection, ",") For i = 0 To UBound(arr) Set m = Application.Session.GetItemFromID(arr(i)) MsgBox m.Subject Next End Sub Or am I going at this backwards, does (Will return a list of all e-mails that have arrived since this event last fired) mean that if I receive 5 e-mails, the first one will trigger.. but the next time I receive an e-mail the previous 4 , plus the one just in will trigger? And if so, won't that leave a few e-mails always in limbo? -- When you lose your mind, you free your life. |
#2
|
|||
|
|||
![]()
Don't use a MsgBox to test any kind of automatic processing, because it's
modal and will stop execution while the box is displayed. Use Debug.Print instead. If you're working with an Exchange account in cached mode, NewMailEx will fire for every single item received, so you'll see only one entry ID each time. In online mode, it will return multiple items, but may skip a small number under extremely heavy loads. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "ben" (remove this if mailing direct) wrote in message ... When using NewMailEx to get a list of received e-mails, EntryIDCollection will only return the very first e-mail received, even if 10-15 e-mails come in at the same time. This is my code in it's entirety. Private Sub Application_NewMailEx(ByVal EntryIDCollection As String) Dim arr() As String Dim i As Integer Dim m As MailItem On Error Resume Next arr = Split(EntryIDCollection, ",") For i = 0 To UBound(arr) Set m = Application.Session.GetItemFromID(arr(i)) MsgBox m.Subject Next End Sub Or am I going at this backwards, does (Will return a list of all e-mails that have arrived since this event last fired) mean that if I receive 5 e-mails, the first one will trigger.. but the next time I receive an the previous 4 , plus the one just in will trigger? And if so, won't that leave a few e-mails always in limbo? |
#3
|
|||
|
|||
![]()
Sue,
Thank you, that was precisely the problem. Changed my code to mark all incoming messages as read for testing, and worked like a charm. I was a little lost because all the examples I found used MsgBox for testing. -- When you lose your mind, you free your life. "Sue Mosher [MVP]" wrote: Don't use a MsgBox to test any kind of automatic processing, because it's modal and will stop execution while the box is displayed. Use Debug.Print instead. If you're working with an Exchange account in cached mode, NewMailEx will fire for every single item received, so you'll see only one entry ID each time. In online mode, it will return multiple items, but may skip a small number under extremely heavy loads. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "ben" (remove this if mailing direct) wrote in message ... When using NewMailEx to get a list of received e-mails, EntryIDCollection will only return the very first e-mail received, even if 10-15 e-mails come in at the same time. This is my code in it's entirety. Private Sub Application_NewMailEx(ByVal EntryIDCollection As String) Dim arr() As String Dim i As Integer Dim m As MailItem On Error Resume Next arr = Split(EntryIDCollection, ",") For i = 0 To UBound(arr) Set m = Application.Session.GetItemFromID(arr(i)) MsgBox m.Subject Next End Sub Or am I going at this backwards, does (Will return a list of all e-mails that have arrived since this event last fired) mean that if I receive 5 e-mails, the first one will trigger.. but the next time I receive an the previous 4 , plus the one just in will trigger? And if so, won't that leave a few e-mails always in limbo? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
The EntryID in NewMailEx Event | Al_21_11[_2_] | Add-ins for Outlook | 1 | July 2nd 09 02:07 PM |
Problem using NewMailEx | Trefor | Outlook and VBA | 10 | May 30th 08 03:41 PM |
NewMailEx Code runs only once... | Rafael[_2_] | Outlook - Using Forms | 0 | September 9th 07 03:10 AM |
Sending mail from NewMailEx deletes the mail from the Inbox | Ron | Outlook and VBA | 1 | January 10th 07 07:40 PM |
NewMailEx vs. ItemAdd | Mark Rae | Outlook and VBA | 14 | June 15th 06 03:07 PM |