almost there: installed redemption for sending email

  • Thread starter Thread starter michael c
  • Start date Start date
M

michael c

I installed redemption to get around the outlook 2003
patch and have modified my code but i get a compile error
that reads "method or data member not found" and stops on
the .CreateItem line below. Any suggestions would be a
huge help and very appreciated. Thanks!!


Set db = CurrentDb

Set rs = db.OpenRecordset("SELECT * " & _
"FROM [qryDistributionList]"

If Not rs.EOF Then
Do While Not rs.EOF

Dim SafeItem, oItem
Set SafeItem = CreateObject
("Redemption.SafeMailItem")
Dim SafeItem, oItem
Set SafeItem = CreateObject("Redemption.SafeMailItem")
Set oItem = Application.CreateItem(0)
SafeItem.Item = oItem
SafeItem.Recipients.Add rs![EmailAddress]
SafeItem.Recipients.ResolveAll
SafeItem.Subject = "Test Subject"
SafeItem.Body = "Test Body"
SafeItem.Send

rs.MoveNext

Loop
End If

End If

End Sub
 
michael c said:
I installed redemption to get around the outlook 2003
patch and have modified my code but i get a compile error
that reads "method or data member not found" and stops on
the .CreateItem line below. Any suggestions would be a
huge help and very appreciated. Thanks!!


Set db = CurrentDb

Set rs = db.OpenRecordset("SELECT * " & _
"FROM [qryDistributionList]"

If Not rs.EOF Then
Do While Not rs.EOF

Dim SafeItem, oItem
Set SafeItem = CreateObject
("Redemption.SafeMailItem")
Dim SafeItem, oItem
Set SafeItem = CreateObject("Redemption.SafeMailItem")
Set oItem = Application.CreateItem(0)
SafeItem.Item = oItem
SafeItem.Recipients.Add rs![EmailAddress]
SafeItem.Recipients.ResolveAll
SafeItem.Subject = "Test Subject"
SafeItem.Body = "Test Body"
SafeItem.Send

rs.MoveNext

Loop
End If

End If

End Sub

I'm not familiar with the Redemption object model, but aside from the
fact that your posted code has the object declarations and the creation
of SafeItem twice, this line:
Set oItem = Application.CreateItem(0)

is plainly in error. The Access Application object has no CreateItem
method. I don't know if it should be

Set oItem = SafeItem.CreateItem(0)

or if there's some other object factory provided by Redemption.
 
Thanks, Dirk. Sorry to be so sloppy. I'm new to the object
model stuff and should probably spend some time ploughing
through it. Thanks again for the help.
-----Original Message-----
I installed redemption to get around the outlook 2003
patch and have modified my code but i get a compile error
that reads "method or data member not found" and stops on
the .CreateItem line below. Any suggestions would be a
huge help and very appreciated. Thanks!!


Set db = CurrentDb

Set rs = db.OpenRecordset("SELECT * " & _
"FROM [qryDistributionList]"

If Not rs.EOF Then
Do While Not rs.EOF

Dim SafeItem, oItem
Set SafeItem = CreateObject
("Redemption.SafeMailItem")
Dim SafeItem, oItem
Set SafeItem = CreateObject("Redemption.SafeMailItem")
Set oItem = Application.CreateItem(0)
SafeItem.Item = oItem
SafeItem.Recipients.Add rs![EmailAddress]
SafeItem.Recipients.ResolveAll
SafeItem.Subject = "Test Subject"
SafeItem.Body = "Test Body"
SafeItem.Send

rs.MoveNext

Loop
End If

End If

End Sub

I'm not familiar with the Redemption object model, but aside from the
fact that your posted code has the object declarations and the creation
of SafeItem twice, this line:
Set oItem = Application.CreateItem(0)

is plainly in error. The Access Application object has no CreateItem
method. I don't know if it should be

Set oItem = SafeItem.CreateItem(0)

or if there's some other object factory provided by Redemption.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


.
 
Back
Top