LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc
external usenet poster
 
Posts: 284
Default Create Outlook Distribution lists in Excel VBA

Below is the example from VBA help that shows how to add members. I don't
find it intuitive but it is the way it is.

Sub AddNewMembers()
Dim myOlApp As New Outlook.Application
Dim myNameSpace As Outlook.NameSpace
Dim myDistList As Outlook.DistListItem
Dim myTempItem As Outlook.MailItem
Dim myRecipients As Outlook.Recipients
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myDistList = myOlApp.CreateItem(olDistributionListItem)
Set myTempItem = myOlApp.CreateItem(olMailItem)
Set myRecipients = myTempItem.Recipients
myDistList.DLName = _
InputBox("Enter the name of the new distribution list")
myRecipients.Add myNameSpace.CurrentUser.Name
myRecipients.Add "Dan Wilson"
myRecipients.ResolveAll
myDistList.AddMembers myRecipients
myDistList.Save
myDistList.Display
End Sub


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I create a probability distribution in excel? Spunkybear Excel Worksheet Functions 2 October 13th 06 01:09 PM
can i create normal distribution curves in excel? Hugsie Bear Excel Discussion (Misc queries) 1 July 14th 06 12:12 PM
Creating Outlook Distribution List Ed Kura Excel Discussion (Misc queries) 2 July 19th 05 01:56 PM
How do I create an Outlook distribution list from an Excel column Mike Officer Excel Discussion (Misc queries) 2 June 24th 05 04:45 AM
How do I move excel address lists to outlook. and vice versa. Lost in Office Excel Discussion (Misc queries) 1 April 9th 05 04:35 PM


All times are GMT +1. The time now is 02:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"