Creating a personal distribution list programatically

C

cmoietvous

Hi All
Well im beginning to pull my hair out! - All I want to do is to create
an Outllok personal distribution list using a .vbs file, here is the code I
have so far, it creates the DL but fails to add the single recipient to the
DL :


Dim CdoSession
Dim CdoAddressLists
Dim CdoAddressList
Dim CdoAddressEntries
Dim CdoAddressEntry
Dim CdoAddressEntriesColl
Dim CdoAddressEntryNewMember




' Create a new Session object and log on.
Set CdoSession = CreateObject("MAPI.Session")
CdoSession.Logon

' Get the Personal Address Book's AddressEntries collection
Set CdoAddressLists = CdoSession.AddressLists
Set CdoAddressList = CdoAddressLists.Item("Contacts")
Set CdoAddressEntries = CdoAddressList.AddressEntries


' Add a new entry for the distribution list.
Set CdoAddressEntry = CdoAddressEntries.Add("MAPIPDL", "DL11")


Set CdoAddressEntryNewMember= CdoAddressEntry.Members.Add("SMTP",
"TEST","(e-mail address removed)")

' Save the changes.
CdoAddressEntry.Update
 

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