i have been searching the internet for two hrs now and i am really confused
with what i have to do. i have a table with all my clients' email addresses.
my goal is to send separate email with pdf attachment to each customer
separately (not like bcc).
i assume i have to create a form with message subject, message body, etc.
then i need a "sendemailtoall" command button.
could someone help me? i am using office 2003.
Angie,
Seeing as no one else has answered I'll try and help.
This is how I do it, I have a form with an email button and the
following code behind the button.
Dim Msg As String
Dim strName As String
blnOK = True
Set rs = Me.RecordsetClone
If rs.RecordCount > 0 Then
rs.MoveFirst
While Not rs.EOF
strEmail = rs!EmailName '[EmailName]
strID = rs!StudentID
strName = rs!LastName
[ThisID] = strID
Msg = "You have Emailed report to " & [strName]
'This line prints copy of emailed report
DoCmd.OpenReport "NotComplete", acViewNormal, ,
"[StudentID] =" & Forms![frm_qry_22_EmailIncomplete]![ThisID]
'This line sends report
DoCmd.SendObject acSendReport, "NotComplete",
acFormatPDF, strEmail, , , txtSubject, txtMessage, False
MsgBox Msg
DoCmd.Close acReport, "NotComplete"
rs.MoveNext
Wend
rs.Close
Set rs = Nothing
End If
End If
I do this from a form with a recordset based on a query showing all
the email address I've selected to email. I open a clone of the
recordset then work my way through each record sending them an email.
txtSubject and txtMessage are text boxes on the form where I type out
a one standard subject and message for all the emails. I'm not sure
if you can use acFormatPDF with access 2003 you may have to go to
acFormatRTF. I do this with Access 2007 and use the PDF addon.
Hope that helps
Rick