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
A New Outlook - Cannot drag IMAP emails to Task List in MyDay Using Outlook 0
L Android Outlook Doesn't Update PC Notification Changes Using Outlook 0
A How to open Excel file saved in Outlook folder? Outlook VBA and Custom Forms 4
D.Moore Outlook desktop client suggested searches question Using Outlook 16
Y Outlook 2016 (64-bit) Copy Local Cal. Events to Another Cal. with Modified Reminder time Using Outlook 2
T Outlook 2019 While connecting an IMAP account in "classic" Outlook 2024 I caused a massive duplication of emails on the server (death loop) Using Outlook 5
D Cannot logon to Outlook.com, or outlook on Mac, outlook not updating on ipad, iphone Using Outlook 1
J unable to get my new install of Outlook to display mailboxes in the single-line format. Using Outlook 1
D Legacy Microsoft Outlook for Mac Support will end in Oct 2025 Using Outlook 5
C Nasty Bug Lurking In Outlook For Years. The Trigger. Any Fix Or Workaround? Using Outlook 11
R Auto clicking Hyperlink in outlook Outlook VBA and Custom Forms 7
ughlook Open multiple contacts in NEW Outlook? Using Outlook 3
G Outlook translation feature is off Using Outlook 2
J Outlook 2010 does not let me put any account Using Outlook.com accounts in Outlook 3
P 3 of 5 PST files don't install from d:\outlook but only from D:\ Using Outlook 7
HarvMan January Windows 10 preview update force installs new Outlook Using Outlook 1
L Outlook 2010 - new installation on Windows 11 - aplzod32.dll is not a valid Add-in Using Outlook 12
J Outlook troubleshooting/logging - option grayed out Using Outlook 2
B Arrows missing from Outlook emails vertical scrollbar Using Outlook 0
G Outlook 2021 (New) doesn't respect default browser Using Outlook 9
B Outlook or iPhone turning tabs into spaces in Outlook Notes Using Outlook 1
P newly installed Office 365 includes OLD Outlook Using Outlook 6
R Outlook ribbon menu default? Using Outlook 7
H Spam email in Gmail not visible in Outlook Using Outlook 3
J How to transfer Win 10 Outlook to new Windows 11 pc? Using Outlook 16
J Renegade spam URL line displayed in old local Outlook 365 email title Using Outlook 3
G Reduce whitespace in Outlook desktop Contact Cards display Using Outlook 3
C Outlook classic via 365 Using Outlook 2
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 8
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 8
P Outlook 2016 Working Offline Using Outlook 2
Rupert Dragwater Cannot reestablish gmail (email address) account in Outlook 365 Using Outlook 11
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

Similar threads

Back
Top