Distribution List - Add New Member not an existing Contact.

  • Thread starter Fred Jacobowitz
  • Start date
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
 
F

Fred Jacobowitz

I figured this one out.

I am doing something like this;

Sub AddNewMembers()
'Dim redemption As New redemption
'Dim safedistlist As safedistlist
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
Dim sAddress As String

Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myDistList = myOlApp.CreateItem(olDistributionListItem)

Set myTempItem = myOlApp.CreateItem(olMailItem)
Set myRecipients = myTempItem.Recipients


myDistList.DLName = "3905Distribution"
Call OpenDistributionFile
giIndex = -1
sAddress = NextAddress
Do Until sAddress = ""

myRecipients.Add sAddress ' ************************* sAddress is
an email address
'myRecipients.Add myNameSpace.CurrentUser.Address

'myRecipients.ResolveAll
sAddress = NextAddress
Loop

myDistList.AddMembers myRecipients
myDistList.Save
myDistList.Display

End Sub
But, now I want to know how to delete an existing distribution list?

Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top