I am using
VBA in Access and need to look up names in the
Global Address Book. I can get to the address book and
start looking for the name I want, however there are over
95,000 entries and it can take forever! I looked at the
Filter objcet of the AddressEntries Collection, but only
in print. This object does not exist on my machine. I
have a reference to the Outlook 9 Object Library. I am
using Outlook 2000 SR-1 version 9.0.0.5414.
Short of using a for next loop to get each name and
compare it to the desired name, how can I do this?
If I use AddressEntryFilter any where in my code
(including the Dim statement) I get an error.
Dim MyFilter As AddressEntryFilter '<---Error
Userdefined Type not defined
Dim i As Long
Set OL = New Outlook.Application
Set NS = OL.GetNamespace("MAPI")
Set AddList = NS.AddressLists("Global Address List")
Set Entries = AddList.AddressEntries
Set MyFilter = Entries.Filter '<---Error Object
not supported
MyFilter.Name = "Stewart, Scott"
For i = 1 To Entries.Count '<-- this is >
95,000
If Left(Entries.Item(i).Name, 14) = "Stewart,
Scott" Then Stop
Next
Scott