dhancy
Board Regular
- Joined
- Jul 10, 2013
- Messages
- 123
- Office Version
- 365
- Platform
- Windows
I am so glad this site allows questions on other applications too. It's been super helpful with Excel, but now I have questions about Outlook VBA as well.
I have many questions, but for starters, I am trying to add email address to (and delete from) to distribution list in the GAL.
The code snippet here successfully finds my distribution list and prints all the members:
But how do I add to this list (or delete from it)? I have searched online but haven't found anything of value yet.
Thanks for your help!
Dennis
I have many questions, but for starters, I am trying to add email address to (and delete from) to distribution list in the GAL.
The code snippet here successfully finds my distribution list and prints all the members:
VBA Code:
Dim olEntry As Outlook.AddressEntry
Dim olDL As Outlook.ExchangeDistributionList
Dim i As Long
Set olEntry = Application.Session.GetGlobalAddressList.AddressEntries("XYZ")
Set olDL = olEntry.GetExchangeDistributionList
For i = 1 To olEntry.Members.Count
Debug.Print olDL.Members.Item(i), olEntry.Members.Item(i).GetExchangeUser.PrimarySmtpAddress
Next i
But how do I add to this list (or delete from it)? I have searched online but haven't found anything of value yet.
Thanks for your help!
Dennis