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 and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Outlook Distribution List contents



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old March 4th 10, 09:52 PM posted to microsoft.public.outlook.program_vba
scottb2
external usenet poster
 
Posts: 9
Default Outlook Distribution List contents


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.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
Outlook Distribution List contents scottb2 Outlook - General Queries 1 March 4th 10 05:43 PM
embedded distribution list to new distribution list in outlook Brad Tulin Outlook - Using Contacts 2 October 22nd 08 01:20 AM
how do I export contents of a distribution list to Excel? DAVID FREEBAKER Outlook - Using Contacts 1 June 26th 08 11:13 AM
Why do distribution list contents delete? pwaldon Outlook - Using Contacts 2 July 11th 07 10:29 PM
How to create a distribution list based on contents of a text file yjwonder Outlook - Using Contacts 1 January 9th 06 10:12 PM


All times are GMT +1. The time now is 11:38 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.