ExchangeUser.GetMemberOfList Method (Outlook)
expression A variable that represents an ExchangeUser object.
An AddressEntries collection object that represents the Exchange distribution lists to which the ExchangeUser belongs. Returns an AddressEntries collection object with a count of zero (0) if the ExchangeUser is not a member of any Exchange distribution list.
The following code sample shows how to obtain the names of the Exchange distribution lists to which the manager of the current user belongs. It uses the ExchangeUser object to obtain specific Exchange user information such as the user's Exchange account alias, details about the user's manager, and the distribution lists that the user's manager has joined.
Sub ShowManagerDistLists() Dim oAE As Outlook.AddressEntry Dim oExUser As Outlook.ExchangeUser Dim oDistListEntries As Outlook.AddressEntries 'Obtain the AddressEntry for CurrentUser Set oExUser = _ Application.Session.CurrentUser.AddressEntry.GetExchangeUser 'Obtain distribution lists that the user's manager has joined Set oDistListEntries = oExUser.GetExchangeUserManager.GetMemberOfList For Each oAE In oDistListEntries If oAE.AddressEntryUserType = _ olExchangeDistributionListAddressEntry Then Debug.Print (oAE.name) End If Next End Sub