S
scottb2
I have a folder hierarchy of
Public folders
...All Public Folders
......Dept
.........Distribution List
Distribution List has a DefaultItemType of "olContactItem" and
DefaultMessageClass of "IPM.Contact".
I have scanned the folder chain and have a Folder object fo
"Distribution List" if that helps.
I wish to take a list of Contacts and create a distribution list i
"Distribution List", of course I understand that a DL contains onl
a name and email address but my requirement is that the user be able t
see all of the contact information when clicking on a DL member.
Any help to accomplish this is appreciated. My attempt is at the en
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()
Public folders
...All Public Folders
......Dept
.........Distribution List
Distribution List has a DefaultItemType of "olContactItem" and
DefaultMessageClass of "IPM.Contact".
I have scanned the folder chain and have a Folder object fo
"Distribution List" if that helps.
I wish to take a list of Contacts and create a distribution list i
"Distribution List", of course I understand that a DL contains onl
a name and email address but my requirement is that the user be able t
see all of the contact information when clicking on a DL member.
Any help to accomplish this is appreciated. My attempt is at the en
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()