F
Fred Jacobowitz
Distribution List - Add New Member not an existing Contac
I am using Outlook 2003 and would like to add a receipient to a distribution
list. I did my homework and found the example below. It works great except
the receipient must be a contact.
Under Outlook 2003 the receipient does not have to be a "contact" (as shown
in the example below (myRecipients.add "Ellen Krantweiss").
Instead you can enter the
Display Name and E-mail address. These is an option to add it to the
contact list. But the point being, the recipient does not need to be on the
contact list.
Can anyone point me in the write direction?
Thank you.
Fred Jacobowitz
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 "Ellen Krantweiss"
myRecipients.ResolveAll
myDistList.AddMembers myRecipients
myDistList.Save
myDistList.Display
End Sub
I am using Outlook 2003 and would like to add a receipient to a distribution
list. I did my homework and found the example below. It works great except
the receipient must be a contact.
Under Outlook 2003 the receipient does not have to be a "contact" (as shown
in the example below (myRecipients.add "Ellen Krantweiss").
Instead you can enter the
Display Name and E-mail address. These is an option to add it to the
contact list. But the point being, the recipient does not need to be on the
contact list.
Can anyone point me in the write direction?
Thank you.
Fred Jacobowitz
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 "Ellen Krantweiss"
myRecipients.ResolveAll
myDistList.AddMembers myRecipients
myDistList.Save
myDistList.Display
End Sub