We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Sub Main() ' TODO: Replace My DL Name with a valid distribution list name. Dim sDLName As String = "My DL Name" ' Create an Outlook application. Dim oApp As Outlook._Application = New Outlook.Application() ' Get the MAPI namespace. Dim oNS As Outlook.NameSpace = oApp.Session ' Get the Global Address List. Dim oALs As Outlook.AddressLists = oNS.AddressLists Dim oGal As Outlook.AddressList = oALs.Item("Global Address List") Console.WriteLine(oGal.Name) ' Get a specific Distribution List. Dim oEntries As Outlook.AddressEntries = oGal.AddressEntries ' Reference the Distribution List by name. Dim oDL As Outlook.AddressEntry = oEntries.Item(sDLName) Console.WriteLine(oDL.Name) Console.WriteLine(oDL.Address) ' Get all the members of the Distribution List. oEntries = oDL.Members Dim oEntry As Outlook.AddressEntry Dim i As Integer For i = 1 To oEntries.Count oEntry = oEntries.Item(i) Console.WriteLine(oEntry.Name) Next ' Clean up. oEntry = Nothing oEntries = Nothing oGal = Nothing oALs = Nothing oNS = Nothing oApp = Nothing End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.