loop through distribution group (and potentially, embedded DGs) by

K

ker_01

We have a large distribution group to whom we send various company emails. I
can't be certain (it isn't my list) but I suspect it may include other DG
lists embedded within the master DG.

We are considering a new process for sending out a link to some required
online training; for this to work we would need to send each employee their
own copy of an email with an embedded URL, with a unique identifier embedded
at the end of that URL.

I work primarily in Excel VBA, and I feel fairly comfortable with loops,
creating unique identifiers, and pushing those identifiers to a flat file for
future reference. What I don't know is how to use the Outlook object model to
disassemble DGs (and embedded DGs) so I can actually loop through one
recipient at a time. Can anyone provide a link, or a line of code that takes
a DG and returns each 'member', and whether or not that member is another DG?

Many thanks,
Keith
 
D

Dmitry Streblechenko

If you are working with the recipeints, Recipient.AddressEntry.Members will
contains the DL members (otehrwise it is null).
In case of DistListItem object, use DistListItem.GetMember method.
In both cases, you would need to recursively loop through the members.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top