How can I get an email address from the GAL

C

Constantinetp

I have code attached to a macro button that opens the Global Address
List address book and allows the user to select a name. I then use
that name to send an email to the user. It works great in Excel '03,
but since it uses a CDOsession the code fails in Excel '07.

Can anyone point me to a method to get the GAL without using CDO?
 
J

Joel

This code wil get the gloabal address list. My global List is very long so
I'm not sure how big you list is and what type object do you want to display
the list.

Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myAddressList = myNameSpace.AddressLists("Global Address List")
Set myAddressEntries = myAddressList.AddressEntries
 
C

Constantinetp

This code wil get the gloabal address list.  My global List is very long so
I'm not sure how big you list is and what type object do you want to display
the list.

    Set myOlApp = CreateObject("Outlook.Application")
    Set myNameSpace = myOlApp.GetNamespace("MAPI")
    Set myAddressList = myNameSpace.AddressLists("Global Address List")
    Set myAddressEntries = myAddressList.AddressEntries






- Show quoted text -

My GAL is very large.

I want a pop-up box that allows the user to select a name. I want to
return the name and smtp address of the selection.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top