View Single Post
  #4  
Old December 17th 08, 12:07 PM posted to microsoft.public.outlook.program_vba
VOORSPRONG
external usenet poster
 
Posts: 5
Default Slow retrieving items from Outlook

Sue,

I am looking for a list of the column names to select from to pass with
SetColumns. I can get some columns to work but not all. Would you have the
list for me? Nice when mapped to the functions like SenderName, ReceivedTime
etc.

I also found out that when I pass multiple columnnames in one string with
SetColumns the performance is as poor as without but when I add the selected
columns in individual instructions I do have the performance.

"Sue Mosher [MVP-Outlook]" wrote:

Try using the SetColumns method to retrieve only those properties that you're interested in, e.g.:

.Item.SetColumns ("To, Subject, SentOn")

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Simon Maystre" wrote in message ...

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