Looking up a name in GAB 
Author Message
 Looking up a name in GAB

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



Wed, 20 Jul 2005 01:20:28 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Retriving MobileTelephoneNumber From GAB

2. Retrieve SMTP email addresses of GAB address entries

3. GAB:Global Address Book: Lookup

4. PAB/GAB method for syncing records = ?

5. Exchange GAB and VB

6. Looking for analog to Me.Name, to use on Procedures

7. Looking For Machine Names On A Network

8. Looking for a list of names

9. Looking for DNS resolution of numbers to names

10. Help: Looking for any info on a debugging program named Reveal

11. how to look in named excel cell

12. Name of Icons for "VCR" look

 

 
Powered by phpBB® Forum Software