Outlook Distribution List contents

Status
Not open for further replies.

scottb2

Member
I have a folder hierarchy of




Public folders


> ..All Public Folders


> .....Dept


> ........Distribution List




Distribution List has a DefaultItemType of "olContactItem" and a DefaultMessageClass of "IPM.Contact".




I have scanned the folder chain and have a Folder object for "Distribution List" if that helps.




I wish to take a list of Contacts and create a distribution list in "Distribution List", of course :-) I understand that a DL contains only a name and email address but my requirement is that the user be able to see all of the contact information when clicking on a DL member.




Any help to accomplish this is appreciated. My attempt is at the end of this message.




Thanks,


Scott




Code:
            Outlook.DistListItem oDL;
           Outlook.MailItem tempItem;
           Outlook.Recipients oRecipients;
           bool resolveRet;
 
 

           oDL = oApp.CreateItem(Outlook.OlItemType.olDistributionListItem)
               as Outlook.DistListItem;
 
 

           tempItem = oApp.CreateItem(Outlook.OlItemType.olMailItem) as Outlook.MailItem;
           oRecipients = tempItem.Recipients;
           oDL.DLName = "Associate Email Distribution List";
           foreach (Outlook.ContactItem oContact in contactList)
           {
               oRecipients.Add(oContact.Email1Address);
           }
           resolveRet = oRecipients.ResolveAll();
           oDL.AddMembers(oRecipients);
           oDL.Save();
 
I'm not sure what you're asking. If you double-click on a member of a DL

when the DL is opened that should open the contact representing that DL

member. You do need to double-click to open the contact.

When you have the contact from your list you need to create a Recipient

object to add to the DL. You can either use the NameSpace.CreateRecipient()

method to do that or you can create a dummy email and add the contact

information to that to create the recipient object by using

dummyEmail.Recipients.Add().

Once you have your recipient from the contact you use that to add a new DL

member.

"scottb2" <scottb2.47bklm@invalid> wrote in message

news:scottb2.47bklm@invalid...

> I have a folder hierarchy of

> Public folders
> ..All Public Folders
> .....Dept
> ........Distribution List

> Distribution List has a DefaultItemType of "olContactItem" and a
> DefaultMessageClass of "IPM.Contact".

> I have scanned the folder chain and have a Folder object for
> "Distribution List" if that helps.

> I wish to take a list of Contacts and create a distribution list in
> "Distribution List", of course :-) I understand that a DL contains only
> a name and email address but my requirement is that the user be able to
> see all of the contact information when clicking on a DL member.

> Any help to accomplish this is appreciated. My attempt is at the end
> of this message.

> Thanks,
> Scott

> Code:
> ------------------> Outlook.DistListItem oDL;
> Outlook.MailItem tempItem;
> Outlook.Recipients oRecipients;
> bool resolveRet;

> oDL = oApp.CreateItem(Outlook.OlItemType.olDistributionListItem)
> as Outlook.DistListItem;

> tempItem = oApp.CreateItem(Outlook.OlItemType.olMailItem) as
> Outlook.MailItem;
> oRecipients = tempItem.Recipients;
> oDL.DLName = "Associate Email Distribution List";
> foreach (Outlook.ContactItem oContact in contactList)
> {
> oRecipients.Add(oContact.Email1Address);
> }
> resolveRet = oRecipients.ResolveAll();
> oDL.AddMembers(oRecipients);
> oDL.Save();
> ------------------
> > scottb2
> >
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
W Combine Mail Merge to Distribution List with Auto Attachments - Outlook 2007 Using Outlook 1
F Obtain Members of a Distribution List Outlook 2003 c# Outlook VBA and Custom Forms 1
T Outlook 2003 - Making a distribution list from a contact folder Outlook VBA and Custom Forms 1
S New Outlook Distribution List Location Outlook VBA and Custom Forms 2
S Maintain Outlook Distribution List from Access Outlook VBA and Custom Forms 2
N Distribution list does not sync from Outlook to hotmail Using Outlook.com accounts in Outlook 1
J Outlook 2013 - Exchange 2007 manage distribution group Exchange Server Administration 1
K outlook 2007 Export/Import Distribution lists Using Outlook 1
T Unable to edit Distribution Group membership via Outlook (works via ECP). Exchange Server Administration 7
R Adding members to outlook distribution lists Outlook VBA and Custom Forms 4
C Outlook classic via 365 Using Outlook 1
Dr. Demento Analogous Outlook code to read info into an array (or collection or whatever) Outlook VBA and Custom Forms 7
S Repair Outlook Using Outlook 6
V Outlook Form ListBox is not editable Outlook VBA and Custom Forms 2
F Outlook's contacts Using Outlook 1
D Outlook 2003 stopped dead Using Outlook 2
G Cannot receive emails from gmail account in Outlook 365 Using Outlook 1
E "Cannot display the folder. MS Outlook cannot access the specified file location" Using Outlook 5
P Outlook 2016 Working Offline Using Outlook 2
Rupert Dragwater Cannot reestablish gmail (email address) account in Outlook 365 Using Outlook 12
O Outlook 365 synchronisieren Exchange Server Administration 1
kburrows Outlook Classic - JPG files are corrupted when opened or saved Using Outlook 3
F Sync Outlook Calendar Using Outlook 0
G Change default font size in sticky notes - Outlook Desktop 2021 Using Outlook 2
C VBA in "New Outlook?" Using Outlook 0
D New Outlook with Business Basic Plans Using Outlook 0
D Outlook 2021 not working with Outlook 2003 installed Using Outlook 5
D Outlook 2003 stopped working - get they dialog box asking for username & Password Using Outlook 2
T Outlook 2021 hangs in close on taskbar occasionally Using Outlook 1
M Duplicate removal feature in Outlook 2021 is faulty Using Outlook 2
D.Moore Outlook COM addins source folder Using Outlook 13
P Removing Outlook 365 Account from Send/Receive Using Outlook 3
kburrows Outlook Automatically Merging Contacts Using Outlook 2
A Outlook 2016 Outlook 2016 vs. New Outlook Using Outlook 4
D Outlook Desktop App Email Software Using Outlook 0
efire9207 VBA Outlook Contacts Outlook VBA and Custom Forms 6
M Outlook not logging in to server Using Outlook 0
J Outlook macro to run before email is being send Outlook VBA and Custom Forms 3
R Outlook 2021 change view Using Outlook 2
K Outlook font corrupted in some point sizes, resets on close/open Using Outlook 2
J Is the Windows Outlook Tasks module really going to be gone? Using Outlook 6
F Outlook 2010 and Hotmail Using Outlook 1
A Outlook 2021 needs 'enter' for people search Using Outlook 2
HarvMan Outlook 365 Inbox Font Using Outlook 8
Retired Geek Outlook on MAC delete duplicate Sent emails Using Outlook 0
S New Outlook - IMAP ISSUES and support for addins? Using Outlook 1
C outlook.com fonts Using Outlook 2
mickymakz Common challenges organizations face when integrating SharePoint and Outlook? Exchange Server Administration 0
R Outlook with several IMAP accounts generating folders with 1111 suffix Using Outlook 0
D Send email from Outlook Alias using Mac? Using Outlook 0

Similar threads

Back
Top