View Single Post
  #1  
Old January 18th 07, 02:00 AM posted to microsoft.public.outlook.program_vba
Simon Maystre
external usenet poster
 
Posts: 2
Default Slow retrieving items from Outlook


I am accessing Outlook from Access VBA and whilst the following code works
just fine it seems really slow to just show a list of the mail items that are
in the Inbox are there any suggestions on how this could be speeded up.

Set objFolder = objOutlook.GetNamespace("MAPI").GetDefaultFolder(M ailBox)

With objFolder

lngCount = .Items.Count

If lngCount 0 Then

For Each objOutlookMail In .Items

aryEmails(1, lngCount2) = Nz(objOutlookMail.To, "")
aryEmails(2, lngCount2) = Nz(objOutlookMail.Subject, "")
aryEmails(3, lngCount2) = objOutlookMail.Senton

lngCount2 = lngCount2 + 1

Next

End If

End With

Many thanks


Ads