Creating a nested distribution list using vba

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does any one have sample code on how to create a nest DL using VBA code ?
 
Am Mon, 16 Oct 2006 13:43:01 -0700 schrieb Hal:

What is a "nested" list?
 
Michael

Since DLs have a limit of 160 members or so when the user is on Exchange,
the way around this problem is to create a DL within a DL.. This is also none
as a nested DL.
 
Am Tue, 17 Oct 2006 05:50:02 -0700 schrieb Hal:

Thanks Hal, my dictionary doesn´t know that word.

Here´s a sample of how to do that, however I´m not sure if you really can
reliably workaround the limit:

Public Sub CreateNestedDL()
Dim DL As Outlook.DistListItem
Dim Mail As Outlook.MailItem

' Assuming there´s a DL selected:
Set DL = Application.ActiveExplorer.Selection(1)
Set Mail = Application.CreateItem(olMailItem)

' The DL´s name must be unique so that it resolves:
Mail.Recipients.Add DL.DLName
Debug.Print Mail.Recipients.ResolveAll

Set DL = Application.CreateItem(olDistributionListItem)
DL.AddMembers Mail.Recipients
DL.DLName = "test nest"
DL.Save
DL.Display
End Sub
 

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

Back
Top