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

  • Thread starter Thread starter ker_01
  • Start date Start date
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
 
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
-
 
Back
Top