View Single Post
  #2  
Old May 30th 09, 04:36 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP][_3_]
external usenet poster
 
Posts: 465
Default Get multiple addresses from a contact list

I don't see anything in this code that relates to attaching a distribution
list to a message. Maybe you could clarify what you're trying to do and give
your Outlook version.

Also, no distribution list appears to be involved. Instead, your code
appears to do something with contacts in a particular folder.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Joel" wrote in message
...
Why doesn't this code work. I only cna get one item from the distribution
list

Set myNameSpace = OutApp.GetNamespace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder(olFolderContacts)
Set myContactList = myFolder.Folders(DistListName)
For Each contact In myContactList.Items

Email = contact.Email1DisplayName
Next contact

I'm trying to attach a distribution list to a new email message and can't
figure this out.



Ads