CDO is much more efficient for handling large collections. I've never
heard of specific benchmark figures, but you may want to give it a shot.
Caching is a good option (cache the EntryIDs of the Contacts, rather than
the names), or only loading a subset of a hundred or so.
Eric Legault - B.A, MCP, MCSD, Outlook MVP
---------------------------------------------
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/
>Hi all, I'm working on a Word template macro that will list all of the
>contacts from a public contacts folder in a combo-box. I have the code
[quoted text clipped - 16 lines]
>
>--Doug
Ken Slovak - [MVP - Outlook] - 27 May 2004 17:11 GMT
Eric,
We usually use an estimate of an order of magnitude for the speed difference
between CDO and OOM code, but CDO in secure Outlook versions will fire the
prompts when accessing a contact as a Message even before you access any of
the Fields.

Signature
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
> CDO is much more efficient for handling large collections. I've never
> heard of specific benchmark figures, but you may want to give it a shot.
[quoted text clipped - 5 lines]
> Job: http://www.imaginets.com
> Blog: http://blogs.officezealot.com/legault/
Doug Lowe - 28 May 2004 17:15 GMT
I'm thinking to cache the names as displayed in the combo box and the
EntryID. Then I don't have to access the MAPI folder at all to display the
dialog box. When the user makes a selection I can go to the folder to get
the full contact information. I'll have to figure out a way to determine
when to invalidate the cache & refresh the data from the exchange contacts
list.
I'm looking into some of the other options suggested, especially Redemption.
I'm long on .NET, VB & C# experience but this is my first crack at Outlook
programming and after VB.NET, it's hard to come back to VBA :)
Thanks for all the help everyone, keep it coming!
--Doug
> CDO is much more efficient for handling large collections. I've never
> heard of specific benchmark figures, but you may want to give it a shot.
[quoted text clipped - 26 lines]
> >
> >--Doug
It probably would be somewhat faster to use the SetColumns method for the
Items collection of that folder.
oContacts.Items.SetColumns "LastNameAndFirstName, CompanyName"
Other than that you could the Message object and its Fields collection to
get the contacts as CDO 1.21 Messages and that would be much quicker.
However, CDO is an optional installation for Outlook 2000 and later so it
might not be installed. Also, accessing a contact, even as a Message, using
CDO will fire the security prompts for secure versions of Outlook.

Signature
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
> Hi all, I'm working on a Word template macro that will list all of the
> contacts from a public contacts folder in a combo-box. I have the code
[quoted text clipped - 15 lines]
>
> --Doug
Hello Doug,
> Is there a more efficient way to get these contacts? I'm considering caching
> the contacts in a text file or something on each client's computer.
Use MapiTables in connection with Redemption.
This is the fastest way in my opinion.

Signature
Thomas Wetzel
Synchronize or backup your Outlook quick and easy.
www.synchpst.com