OK.. I made some changed to the code.. A little knowledge is a dangerous thing. Check the attached code out. I replaced the debug statments with the hex code in it with something that seems to work...
I also changed the case statement to make the distribution list a value of 5 (FIVE) when the entry is a distribution list.
The one remaining problem I am having is that the DO until loop for the distribution list never ends.. it finds the first entry over and over and over again... ALmost like the objDistMembers.GetNext statement is not working.
I you can take a quick look at what I have done and advise me on what I might be doing wrong, I would really appreciate it.
Thanks,
George
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
Set objSession = CreateObject("MAPI.Session"

objSession.Logon ("Outlook"

'Get the GAL, can get the PAB the same way
Set objAddrList = objSession.GetAddressList(CdoAddressListPAB)
'Move through the users and distribution lists in the GAL
Set objAddrEntries = objAddrList.AddressEntries
Set objAddrEntry = objAddrEntries.GetFirst
Do Until objAddrEntry Is Nothing
With objAddrEntry
Select Case .DisplayType
Case CdoUser, CdoRemoteUser
'Entry is a user
Debug.Print "Display Name: " & .Name
Debug.Print "display Email address: " & .Address ' added by me
'SMTP e-mail address
' Debug.Print "E-mail address: " & objAddrEntry.Fields(&H39FE001E).Value
Case 5 ' changed by me
'Move through the distribution list members
Set objDistMembers = .Members
Set objDistMember = objDistMembers.GetFirst
Do Until objDistMember Is Nothing '
Debug.Print "Display Name: " & objDistMember.Name
'SMTP e-mail address
Debug.Print objDistMember.Address ' added by me
' Debug.Print "E-mail address: " & objDistMember.Fields(&H39FE001E).Value
objDistMembers.GetNext
Loop
End Select
End With
Set objAddrEntry = objAddrEntries.GetNext
Loop
Set objDistMember = Nothing
Set objDistMembers = Nothing
Set objAddrEntries = Nothing
Set objAddrEntry = Nothing
Set objAddrList = Nothing
Set objSession = Nothing
End Sub