ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How can I get an email address from the GAL (https://www.excelbanter.com/excel-programming/434724-how-can-i-get-email-address-gal.html)

Constantinetp

How can I get an email address from the GAL
 
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?

joel

How can I get an email address from the GAL
 
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


"Constantinetp" wrote:

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?


Constantinetp

How can I get an email address from the GAL
 
On Oct 8, 12:00*pm, Joel wrote:
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



"Constantinetp" wrote:
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?- Hide quoted text -


- 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.

JP[_4_]

How can I get an email address from the GAL
 
Check out the SelectNamesDialog Object, which is available in Outlook
2007.

http://msdn.microsoft.com/en-us/library/bb176400.aspx

--JP

On Oct 8, 12:26*pm, Constantinetp wrote:

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.- Hide quoted text -



All times are GMT +1. The time now is 12:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com