A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - General Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

How to get both a name and email address in a DL



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 4th 10, 04:49 PM posted to microsoft.public.outlook
scottb2
external usenet poster
 
Posts: 9
Default How to get both a name and email address in a DL


I'm using the following code to create a distribution list. Once the
list is created, I go to Contacts, click on the DL, and see that the DL
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 field
(different from the email address)?

Thanks,
Scott


Code:
--------------------

oDL = oApp.CreateItem(Outlook.OlItemType.olDistributionL istItem)
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
http://forums.slipstick.com

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to export Outlook 2007 address book email address Amy Jones Outlook - General Queries 24 January 24th 10 08:59 PM
Can't get SMTP address of contact that shares email address of an Exchange user Jeff Outlook and VBA 14 January 15th 09 12:50 AM
Outlook Address Book requires non-blank email address??? Chris Miller[_2_] Outlook - General Queries 6 August 21st 08 12:14 AM
How do I make a new email address supercede an old email address? dhbirt Outlook - Using Contacts 3 May 13th 06 04:38 AM
Set which local email account can send mail to contacts in address book. (associating an email address with a contact) Scott Streit Outlook - General Queries 3 January 27th 06 02:57 PM


All times are GMT +1. The time now is 03:39 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.