Outlook Object Model: ExchangeDistributionList

%3CLINGO-SUB%20id%3D%22lingo-sub-1622675%22%20slang%3D%22en-US%22%3EOutlook%20Object%20Model%3A%20ExchangeDistributionList%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1622675%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20this%20the%20current%20version%20of%20the%20Outlook%20Object%20Model%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Foffice%2Fvba%2Fapi%2Foutlook.exchangedistributionlist%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Foffice%2Fvba%2Fapi%2Foutlook.exchangedistributionlist%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20this%20code%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3EDim%20olEntry%20As%20Outlook.AddressEntry%0ADim%20olDL%20As%20Outlook.ExchangeDistributionList%0A%0ASet%20olEntry%20%3D%20Application.Session.GetGlobalAddressList.AddressEntries(%22ABC%22)%0ASet%20olDL%20%3D%20olEntry.GetExchangeDistributionList%0A%0ADebug.Print%20olDL.Members.Item(1)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20correctly%20prints%20the%20first%20member%20in%20my%20distribution%20list.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHowever%2C%20when%20I%20view%20the%20object%20model%20from%20the%20link%20above%2C%20it%20does%20*not*%20show%20a%20%22Members%22%20property.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20reason%20I%20ask%20is%20because%20I%20need%20to%20code%20a%20line%20that%20adds%20a%20new%20member%20to%20this%20list.%20I've%20tried%20things%20like%20this%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3Eset%20olEntry2%20%3D%20olDL.members.add(...)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20it%20always%20returns%20an%20error%3A%20%22The%20bookmark%20is%20not%20valid%22.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhere%20can%20I%20find%20the%20proper%20syntax%20to%20add%20a%20new%20member%20to%20an%20ExchangeDistributionList%20object%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDennis%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1622963%22%20slang%3D%22en-US%22%3ERe%3A%20Outlook%20Object%20Model%3A%20ExchangeDistributionList%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1622963%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F774480%22%20target%3D%22_blank%22%3E%40dhancy%3C%2FA%3E%26nbsp%3BAs%20far%20as%20I%20know%2C%20the%20add%20members%20field%20in%20a%20dl%20is%20not%20writable%20using%20VBA.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1623050%22%20slang%3D%22en-US%22%3ERe%3A%20Outlook%20Object%20Model%3A%20ExchangeDistributionList%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1623050%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F75%22%20target%3D%22_blank%22%3E%40Diane%20Poremsky%3C%2FA%3EThanks.%26nbsp%3B%20Is%20there%20any%20workaround%20that%20would%20allow%20a%20new%20member%20to%20be%20added%20to%20an%20Exchange%20Distribution%20List%3F%26nbsp%3B%20I%20have%20been%20looking%20at%20this%20for%20weeks%20without%20making%20a%20lot%20of%20progress.%26nbsp%3B%20Are%20there%20any%20decent%20online%20resources%20you%20could%20suggest%20on%20Outlook%20VBA%20programming%3F%26nbsp%3B%20Or%20perhaps%20even%20a%20book%3F%26nbsp%3B%20Thanks%20again.%3C%2FP%3E%3C%2FLINGO-BODY%3E
New 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.