A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Extract email addresses from Distribution LIst in Global Address List



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old June 21st 06, 04:15 PM posted to microsoft.public.outlook.program_vba
tthomas
external usenet poster
 
Posts: 1
Default Extract email addresses from Distribution LIst in Global Address List

Greetings,
I am using CDO.Message to send email messages from my access application. I
now
need to send email to existing distribution lists in our Global Address List.
However, our exchange server blocks sending to distribution list (i.e.
distribution list is named MyDistList and its email address is
) from SMTP email.

I have searched in vain for an example of VBA that will extract the email
addresses of members of a distribution list from the Global Address List with
a specific name. (I have found code that will use a DL in the contacts but
that doesn't help). I've searched at length thru slipstick, google, etc.
Can anyone help?

much thanks
Teresa

--
Message posted via
http://www.officekb.com
Ads
  #2  
Old June 21st 06, 04:37 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Extract email addresses from Distribution LIst in Global Address List

CDO for Windows (which is what CDO.Message) implies cannot help you with this. Either use ADSI methods or CDO 1.21 or Redemption. The code sample at http://www.cdolive.com/cdo5.htm#DeleteDLMember shows one way of working with GAL DL members with CDO 1.21.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"tthomas" u7607@uwe wrote in message news:621bc3656ced8@uwe...
Greetings,
I am using CDO.Message to send email messages from my access application. I
now
need to send email to existing distribution lists in our Global Address List.
However, our exchange server blocks sending to distribution list (i.e.
distribution list is named MyDistList and its email address is
) from SMTP email.

I have searched in vain for an example of VBA that will extract the email
addresses of members of a distribution list from the Global Address List with
a specific name. (I have found code that will use a DL in the contacts but
that doesn't help). I've searched at length thru slipstick, google, etc.
Can anyone help?

much thanks
Teresa

--
Message posted via
http://www.officekb.com

  #3  
Old June 22nd 06, 12:02 AM posted to microsoft.public.outlook.program_vba
tthomas via OfficeKB.com
external usenet poster
 
Posts: 1
Default Extract email addresses from Distribution LIst in Global Address List

Thanks for the direction...after a lot of fumbling..this is what we came up
with...

Public Function ADLIST(DistName As String) As String
Dim strValue As Variant, EmailMe As String
Set getDn = GetObject("LDAP://CN=" & DistName & ",OU=Distribution
Groups,DC=gunnallen,DC=com")
strAllValues = getDn.getex("member")
For Each strValue In strAllValues
Set getDn2 = GetObject("LDAP://" & strValue)
strEmail = getDn2.getex("mail")
EmailMe = EmailMe & IIf(Len(EmailMe) = 0, "", ", ") &
strEmail(0)
Next
Set strAllValues = Nothing
Set strEmail = Nothing
ADLIST = EmailMe
End Function


Sue Mosher [MVP-Outlook] wrote:
CDO for Windows (which is what CDO.Message) implies cannot help you with this. Either use ADSI methods or CDO 1.21 or Redemption. The code sample at http://www.cdolive.com/cdo5.htm#DeleteDLMember shows one way of working with GAL DL members with CDO 1.21.

Greetings,
I am using CDO.Message to send email messages from my access application. I

[quoted text clipped - 12 lines]
much thanks
Teresa


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...g-vba/200606/1
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a set of email addresses to a distribution list chermesh Outlook - Using Contacts 2 June 4th 06 07:35 AM
Why do names in my distribution list revert to email addresses? Laurey Outlook - Using Contacts 1 March 10th 06 10:18 AM
create new distribution list in global address lists in exchange tim Outlook - Using Contacts 1 February 6th 06 09:52 PM
How do I find the number of email addresses in a distribution list Shockle Outlook - Using Contacts 1 January 30th 06 10:13 PM
how do I print a distribution list from a global address book? Sue Mosher [MVP-Outlook] Outlook - Using Contacts 0 January 18th 06 05:11 PM


All times are GMT +1. The time now is 09:39 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2024 Outlook Banter.
The comments are property of their posters.