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

Outlook not processing all incoming emails



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old September 25th 09, 02:47 AM posted to microsoft.public.outlook.program_vba
John[_11_]
external usenet poster
 
Posts: 83
Default Outlook not processing all incoming emails

Hi

I am using function NewMailEx as per below code to process attachments from
incoming messages. Problem is Outlook is skipping processing some of the
mail items probably when there are a number of them coming at the same time.
What is the problem and how can I fix it? Is there a more robust way to do
this? I have avoided .net add-in due to installation issues.

Thanks

Regards


Private Sub Application_NewMailEx(ByVal EntryIDCollection As String)
Dim arr() As String
Dim i As Integer
Dim ns As Outlook.NameSpace
Dim itm As MailItem
Dim m As Outlook.MailItem

Set ns = Application.Session
arr = Split(EntryIDCollection, ",")

For i = 0 To UBound(arr)
Set itm = ns.GetItemFromID(arr(i))
If itm.Class = olMail Then
Set m = itm
For Each Atmt In m.Attachments
' Do some processing here
Next Atmt
End If
Next

Set ns = Nothing
Set itm = Nothing
Set m = Nothing
End Sub


 




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
Auto processing of incoming mail John[_11_] Outlook and VBA 1 August 24th 09 08:41 PM
Processing incoming emails John[_11_] Outlook and VBA 3 May 21st 08 05:42 PM
Processing incoming emails John[_11_] Add-ins for Outlook 3 May 21st 08 05:42 PM
Processing incoming emails John[_11_] Outlook and VBA 0 May 20th 08 09:06 PM
Processing incoming emails John[_11_] Add-ins for Outlook 0 May 20th 08 09:06 PM


All times are GMT +1. The time now is 08:04 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.