S
scottb2
I'm using the following code to create a distribution list. Once th
list is created, I go to Contacts, click on the DL, and see that the D
member has the email address for both the name and email addr fields.
How do I create a DL recipient that has the desired name fiel
(different from the email address)?
Thanks,
Scott
Code
-------------------
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()
list is created, I go to Contacts, click on the DL, and see that the D
member has the email address for both the name and email addr fields.
How do I create a DL recipient that has the desired name fiel
(different from the email address)?
Thanks,
Scott
Code
-------------------
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()