Adding to a distibution list via Redemption DLL

  • Thread starter Thread starter Andy Rigby
  • Start date Start date
A

Andy Rigby

Hi

I've just started using Redemption to access Outlook from VB and I've
got basic sending and receiving emails working fine.

However, I want to add people into an existing distribution list, and
can't seem to get anything to add into the list.

Office 2000, SP3

My code is like this. I don't get any errors but the (empty) list
never grows:

Dim oOutDist As Outlook.DistListItem
Dim OutDist As Object
Dim OutRecip As Object
Dim oOutRecip As Outlook.Recipients
Dim OutMail As Object
Dim oOutMail As Object
Dim OutFold As Object

Set OutFold = OutNS.GetDefaultFolder(olFolderContacts)
Set oOutDist = OutFold.Items("Name Of The List I Want To Add To")
Set OutMail = CreateObject("Redemption.SafemailItem")
Set oOutMail = OutApp.CreateItem(0)
OutMail.Item = oOutMail
Set OutRecip = OutMail.Recipients

Set OutDist = CreateObject("Redemption.SafeDistlist")
Set OutDist = oOutDist
OutRecip.Add "Email Address I Want To Add"
OutDist.AddMembers OutRecip
OutDist.Save

Set OutDist = Nothing
Set OutMail = Nothing


Any ideas?

Andy
 
Back
Top