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

Status
Not open for further replies.
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)

-

"ker_01" <ker01> wrote in message

news:3C6DA043-D36D-4C30-8609-22A9759FF7D3@microsoft.com...
> 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
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
S Macro for Loop through outlook unread emails Outlook VBA and Custom Forms 2
A VBA macro for 15 second loop in send and received just for 1 specific mailbox Outlook VBA and Custom Forms 1
A ItemAdd on Imap Folder get endless loop after saving item Using Outlook 5
makinmyway Trouble Installing BCM Outlook 2013; Endless Install Loop Happens Using Outlook 0
W Broken Folder Loop - Outlook 2007 (.oft files) Using Outlook 2
Forum Admin Endless loop when to the new Outlook Connector Using Outlook.com accounts in Outlook 0
S Business Contact Manager (BCM) causing Outlook crash loop BCM (Business Contact Manager) 3
H For Each loop not getting all Email Items Outlook VBA and Custom Forms 3
S Loop mail items within a Custom Search Folder Outlook VBA and Custom Forms 1
M If loop not running Outlook VBA and Custom Forms 1
M Outlook VBA Form not finding FOR LOOP -- Error message Outlook VBA and Custom Forms 2
R Loop Attachment (once again) Outlook VBA and Custom Forms 6
A How to create fixed signatures for aliases that process through GMAIL? Outlook VBA and Custom Forms 0
Y Images coming through as Cid:image in outlook Using Outlook 0
Jennifer Murphy Ctrl+Tab sometimes will not move through text a word at a time Using Outlook 1
Rupert Dragwater Scrolling through Directories hesitates Using Outlook 1
N Outlook Email Rule execution through shortcut keys (VBA codes) Using Outlook 1
A Outlook - Send New 20 Attachments through Email Using Outlook 4
A Outlook incompleted tasks has strike through Using Outlook 3
H Custom autoforwarding, sending mail through outlook office 365 Using Outlook 1
A Sending Emails Through Outlook From Multiple Email Addresses Using Outlook 1
T Can't send email through connected account (outlook.live.com) - goes to Drafts folder Using Outlook.com accounts in Outlook 3
Tim King Send mail from MSWord through Outlook Using Outlook 3
P Threat to being a spammer while sending automatic Emails through VBA Using Outlook 3
S Ask user to input email template through VBA Outlook VBA and Custom Forms 1
2 Task has a strike through but is not complete - how to remove? Using Outlook 1
Stefanos Update Sharepoint tasks through Outlook Using Outlook 2
L Outlook 2007 Search Through E-Mail Using Outlook 41
R Outlook Cache Mode Terminalserver disable through Registry Using Outlook 1
T Synchronize outlook appointments through web application. Using Outlook 1
L Cannot send emails through @live.co.uk account in outlook 2013 Using Outlook 0
L Cannot send emails through @live.co.uk account in outlook 2013 Using Outlook 2
C Insert date in Subject through date picker Using Outlook 0
S Send if approved (through email) Using Outlook 1
M syning multiple calendars from Outlook 2007 through iTunes Using Outlook 3
J Using Outlook through BlackBerry Z10 Using Outlook 4
I Outlook 2003 won't send emails through one router, but will through another Using Outlook 1
K Clearing/Deleting all Public Folders through VBA Using Outlook 3
L Reminder default time not going through Using Outlook 7
S Tasks are handled through email but deleted email removes task history? Exchange Server Administration 3
D Line through message instead of sending to Delete folder??? Using Outlook 3
D Outlook Contact Notes show previous history with strike through. Using Outlook 1
I Send Secure Email Through Microsoft Outlook 2007 and 2010 (32 bit) Using Outlook 0
I Send Secure Email Through Microsoft Outlook 2007 and 2010 (32 bit) Using Outlook 0
A Are Public Folders Contacts available through activesync for Windows Phone 7, Iphone, etc? Exchange Server Administration 3
R Multiple Domains routing through multiple send connectors Exchange Server Administration 5
J Create or Import a Outlook Rule through C# code. Outlook VBA and Custom Forms 2
R Access Program Only Looping Part Way Through Outlook Inbox Outlook VBA and Custom Forms 2
C OL Sub through or by Excel Macro Call Outlook VBA and Custom Forms 1
D using outlook 2007 categories through gmail Outlook VBA and Custom Forms 2

Similar threads

Back
Top