Sub GetDLinfo()
Dim olkDL As Outlook.DistListItem, _
olkEntry As Outlook.Recipient, _
olkContact As Outlook.contactItem, _
intCount As Integer, _
strAddress As String
'Get the currently selected distribution list'
Set olkDL = Application.ActiveExplorer.Selection(1)
For intCount = 1 To olkDL.MemberCount
Set olkEntry = olkDL.GetMember(intCount)
strAddress = olkEntry.AddressEntry.Address
Set olkContact = Session.GetDefaultFolder(olFolderContacts).Items.Find("[Email1Address] = '" & strAddress & "' OR [Email2Address] = '" & strAddress & "' OR [Email3Address] = '" & strAddress & "'")
If TypeName(olkContact) = "Nothing" Then
Debug.Print "Not found: " & strAddress
Else
Debug.Print olkContact.BusinessAddressCity & ", " & olkContact.BusinessAddressState
End If
Next
Set olkEntry = Nothing
Set olkDL = Nothing
End Sub
|