![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I know how to make a new DL and add users to a DL via vba but how do I make a
nested distribution list ? Regards |
Ads |
#2
|
|||
|
|||
![]()
Create a dummy e-mail message and address it to the DL you want to nest.
Then retrieve that DL's Recipient object from the MailItem.Recipients collection and pass it to the DistributionList.AddMember method. -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Hal" wrote: I know how to make a new DL and add users to a DL via vba but how do I make a nested distribution list ? Regards |
#3
|
|||
|
|||
![]()
what do you mean pass it to ... do I set distributionlist =
mailitem.receipient ? "Eric Legault [MVP - Outlook]" wrote: Create a dummy e-mail message and address it to the DL you want to nest. Then retrieve that DL's Recipient object from the MailItem.Recipients collection and pass it to the DistributionList.AddMember method. -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Hal" wrote: I know how to make a new DL and add users to a DL via vba but how do I make a nested distribution list ? Regards |
#4
|
|||
|
|||
![]()
Actually, there's another way to do this without creating a dummy e-mail.
This code illustrates retrieving a DL named "TestDistributionList" and adding another existing DL named "AnotherDistributionList" to it: Dim objNS As Outlook.NameSpace Dim objDL As Outlook.DistListItem Dim objContacts As Outlook.MAPIFolder Dim objR As Outlook.Recipient Set objNS = Application.GetNamespace("MAPI") Set objContacts = objNS.GetDefaultFolder(olFolderContacts) Set objDL = objContacts.Items("TestDistributionList") Set objR = objNS.CreateRecipient("AnotherDistributionList") objR.Resolve objDL.AddMember objR objDL.Save Set objDL = Nothing Set objNS = Nothing Set objContacts = Nothing Set objR = Nothing -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Hal" wrote: what do you mean pass it to ... do I set distributionlist = mailitem.receipient ? "Eric Legault [MVP - Outlook]" wrote: Create a dummy e-mail message and address it to the DL you want to nest. Then retrieve that DL's Recipient object from the MailItem.Recipients collection and pass it to the DistributionList.AddMember method. -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Hal" wrote: I know how to make a new DL and add users to a DL via vba but how do I make a nested distribution list ? Regards |
#5
|
|||
|
|||
![]()
Eric
Your code does not produce a DL named AnotherDistributionList in TestDistributionList. I have tested in on a pst and when connected to exchange. Hal "Eric Legault [MVP - Outlook]" wrote: Actually, there's another way to do this without creating a dummy e-mail. This code illustrates retrieving a DL named "TestDistributionList" and adding another existing DL named "AnotherDistributionList" to it: Dim objNS As Outlook.NameSpace Dim objDL As Outlook.DistListItem Dim objContacts As Outlook.MAPIFolder Dim objR As Outlook.Recipient Set objNS = Application.GetNamespace("MAPI") Set objContacts = objNS.GetDefaultFolder(olFolderContacts) Set objDL = objContacts.Items("TestDistributionList") Set objR = objNS.CreateRecipient("AnotherDistributionList") objR.Resolve objDL.AddMember objR objDL.Save Set objDL = Nothing Set objNS = Nothing Set objContacts = Nothing Set objR = Nothing -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Hal" wrote: what do you mean pass it to ... do I set distributionlist = mailitem.receipient ? "Eric Legault [MVP - Outlook]" wrote: Create a dummy e-mail message and address it to the DL you want to nest. Then retrieve that DL's Recipient object from the MailItem.Recipients collection and pass it to the DistributionList.AddMember method. -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Hal" wrote: I know how to make a new DL and add users to a DL via vba but how do I make a nested distribution list ? Regards |
#6
|
|||
|
|||
![]()
The code isn't making another DL. It assume the existence of both
AnotherDistributionList and TestDistributionList. It retrieves the latter and adds the former as a member. -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Hal" wrote: Eric Your code does not produce a DL named AnotherDistributionList in TestDistributionList. I have tested in on a pst and when connected to exchange. Hal "Eric Legault [MVP - Outlook]" wrote: Actually, there's another way to do this without creating a dummy e-mail. This code illustrates retrieving a DL named "TestDistributionList" and adding another existing DL named "AnotherDistributionList" to it: Dim objNS As Outlook.NameSpace Dim objDL As Outlook.DistListItem Dim objContacts As Outlook.MAPIFolder Dim objR As Outlook.Recipient Set objNS = Application.GetNamespace("MAPI") Set objContacts = objNS.GetDefaultFolder(olFolderContacts) Set objDL = objContacts.Items("TestDistributionList") Set objR = objNS.CreateRecipient("AnotherDistributionList") objR.Resolve objDL.AddMember objR objDL.Save Set objDL = Nothing Set objNS = Nothing Set objContacts = Nothing Set objR = Nothing -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Hal" wrote: what do you mean pass it to ... do I set distributionlist = mailitem.receipient ? "Eric Legault [MVP - Outlook]" wrote: Create a dummy e-mail message and address it to the DL you want to nest. Then retrieve that DL's Recipient object from the MailItem.Recipients collection and pass it to the DistributionList.AddMember method. -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Hal" wrote: I know how to make a new DL and add users to a DL via vba but how do I make a nested distribution list ? Regards |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Adding mutliple distribution lists into a distribution list? | Abel | Outlook - Using Contacts | 2 | August 30th 06 06:51 PM |
Distribution Lists sourced from linked SharePoint Contact Lists | Marcela | Outlook - Using Contacts | 4 | July 17th 06 01:08 AM |
Distribution Lists | Ada | Outlook - Using Contacts | 3 | May 12th 06 12:09 AM |
Distribution Lists | Christine | Outlook - Using Contacts | 2 | March 20th 06 09:43 PM |
Nested Distribution Lists in shared contacts don't work | Doda McCheesle | Outlook - Using Contacts | 0 | February 24th 06 01:02 PM |