Outlook Object Model: ExchangeDistributionList

Copper Contributor

Hello,

 

Is this the current version of the Outlook Object Model?

 

https://docs.microsoft.com/en-us/office/vba/api/outlook.exchangedistributionlist

 

I have this code:

Dim olEntry As Outlook.AddressEntry
Dim olDL As Outlook.ExchangeDistributionList

Set olEntry = Application.Session.GetGlobalAddressList.AddressEntries("ABC")
Set olDL = olEntry.GetExchangeDistributionList

Debug.Print olDL.Members.Item(1)

 

This correctly prints the first member in my distribution list.

 

However, when I view the object model from the link above, it does *not* show a "Members" property.

 

The reason I ask is because I need to code a line that adds a new member to this list. I've tried things like this:

 

set olEntry2 = olDL.members.add(...)

 

But it always returns an error: "The bookmark is not valid". 

 

Where can I find the proper syntax to add a new member to an ExchangeDistributionList object?

 

Thanks,

 

Dennis

2 Replies

@dhancy As far as I know, the add members field in a dl is not writable using VBA. 

@Diane PoremskyThanks.  Is there any workaround that would allow a new member to be added to an Exchange Distribution List?  I have been looking at this for weeks without making a lot of progress.  Are there any decent online resources you could suggest on Outlook VBA programming?  Or perhaps even a book?  Thanks again.