|Outlook Developer Reference|
Version Added: Outlook 2007
ExchangeDistributionList is a derived class of AddressEntry, and is returned instead of an AddressEntry when the caller performs a QueryInterface on the AddressEntry.
The AddressEntry.Members property supports enumerating members of a distribution list. ExchangeDistributionList adds the first-class properties for Alias, Comments, and PrimarySmtpAddress. You can also access other properties specific to the Exchange distribution list that are not exposed in the object model through the PropertyAccessor object.
Some properties such as Comments are read-write properties. Setting these properties requires the code to be running under an appropriate Exchange administrator account; without sufficient permissions, calling the ExchangeUser.Update method will result in a "permission denied" error.
The following code sample shows how to obtain the names of the Exchange distribution lists that the current user's manager belongs to. It uses the ExchangeUser.GetExchangeUserManager method to obtain information about the user's manager, and uses ExchangeUser.GetMemberOfList to obtain the distribution lists (represented by ExchangeDistributionList objects) that the manager has joined.
|Visual Basic for Applications|