![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
On Aug 15, 6:50 pm, "Dmitry Streblechenko" wrote:
That *is* the actual e-mail address, but its type happens to be "EX", not "SMTP". You will need to read the PR_EMS_AB_PROXY_ADDRESSES property using objAddrEntry.Fields[]. -- Dmitry Streblechenko (MVP)http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool -"McKilty" wrote in message ... I need to loop every Distribution List and get the names and SMTP address of each member. Instead of the I am getting /o=SomeCompany/ou=Domain/cn=Recipients/cn=RJones. How can I get the actual e-mail address? The code I'm using: Private Sub Command1_Click() Dim objSession As MAPI.Session Dim objAddrList As MAPI.AddressList Dim objAddrEntries As MAPI.AddressEntries Dim objAddrEntry As MAPI.AddressEntry Dim objDistMembers As MAPI.AddressEntries Dim objDistMember As MAPI.AddressEntry Open "C:\DL.txt" For Output As #1 Set objSession = CreateObject("MAPI.Session") objSession.Logon ("Outlook") Set objAddrList = objSession.GetAddressList(CdoAddressListGAL) 'Move through the users and distribution lists in the PAB Set objAddrEntries = objAddrList.AddressEntries Set objAddrEntry = objAddrEntries.GetFirst Do Until objAddrEntry Is Nothing With objAddrEntry Select Case .DisplayType Case 1 'Move through the distribution list members Set objDistMembers = .Members Set objDistMember = objDistMembers.GetFirst Print #1, objAddrEntry.Name Do Until objDistMember Is Nothing ' Print #1, Chr(9) & objDistMember.Name & Chr(9) & objDistMember.Address Set objDistMember = objDistMembers.GetNext Loop End Select End With Set objAddrEntry = objAddrEntries.GetNext Loop Close #1 Set objDistMember = Nothing Set objDistMembers = Nothing Set objAddrEntries = Nothing Set objAddrEntry = Nothing Set objAddrList = Nothing Set objSession = Nothing End Sub Yeah, I figured I would be using the wrong terminology. Looking at my code, is it simple to incorporate that code? I'm going to give it a shot, but I'm pretty rusty... |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to count the members of a distribution list? | Alan | Outlook - General Queries | 1 | April 16th 08 04:00 PM |
can the members of distribution list be hidden? | DumbCluck | Outlook - Using Contacts | 1 | April 11th 07 03:39 PM |
Members of Distribution List cannot be found | Tom | Outlook - Using Contacts | 5 | February 21st 07 02:57 AM |
Exporting Members on a distribution list | WooYing | Outlook - Using Contacts | 3 | September 29th 06 06:08 AM |
members missing from distribution list | EZim | Outlook - Using Contacts | 0 | March 20th 06 05:04 PM |