Send emails of reports through access

sandrao

Registered User.
Local time
Today, 16:38
Joined
Sep 6, 2007
Messages
34
I am still trying to find a way to use code to send email through access of reports.

I would like to have the ability to send more that one email to several addresses.
 
I do have a code for SendObject. But it opens outlook with the attachment then I have to click send button to complete the message.

DoCmd.SendObject acReport,"report", acFormatRTF,"my email address",,,"Subject",,True

what else could I add to send the message without opening Outlook?

 
The last argument for SendObject specifies whether the mail is sent automatically or left open for editing.
 
Thanks! Changed it to False and everything works fine.

Thanks again!
 
One other question. If I wanted to have a Combo Box on the form with Email address attached how could I get the code to accept email address on the form without including it as part of the code. Mainly because the reports have a potential to be sent to over a dozen agents.
 
Instead of "my email address", you can use

Me.ComboBoxName
 
Is there a way to modify my original code to be able to send a report to ALL email address in a field? If so could you be an example of that code.
 
If you mean all the addresses in a table, the link I posted has the type of loop needed.
 
have found the following code with the loop

Private Sub SendAll_Click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strTo As String
Set db = CurrentDb()
Set rs = CurrentDb.OpenRecordset("Emailer", dbOpenSnapshot)
With rs
Do While Not .EOF
strTo = !Email & ";" & strTo
.MoveNext
Loop
End With
DoCmd.SendObject acReport, Me.txtReport, acFormatRTF, strTo
rs.Close
Set rs = Nothing
Set db = Nothing
End Sub

now I get error 2501 then sendObject canceled.

so far no one has come up with a solution....

any suggestions????
 
Some thoughts are posted on your other thread.
 

Users who are viewing this thread

Back
Top Bottom