Report in Email Body

hootie318

Registered User.
Local time
Today, 01:38
Joined
Oct 28, 2003
Messages
130
I have to put a simple report in the body of an email. I am running limited resources and am looking for a basic code to do so.

Private Sub Command28_Click()
On Error GoTo ErrorHandler

Dim strToWhom As String
Dim strSubject As String
Dim strMsgBody As String

strSubject = "Fax Delv and Driver Count for"
strToWhom = "me@anyplace.net"
strMsgBody =

DoCmd.SendObject , faxreportqueryreport, , strToWhom, , , strSubject, strMsgBody, True

Exit Sub
ErrorHandler:
Select Case Err.Number
Case 2501
Resume Next
Case Else
MsgBox "Err " & Err.Number & ": " & Err.Description
End Select

End Sub

I cant figure out what to put for strMsgBody =
The report name doesnt work
 
If you want to do anything complex with the body i suggest you work with an outlook object and use HTML body, you will need to check off the outlook object in referances. www.outlookcode.com, there are some samples there that might aid you, Other than that you have to write out the body yourself with the send object method. Also if you want to you might consider just attaching the report to the email and putting some standard text as the body such as "this is an email with the report attached"
 

Users who are viewing this thread

Back
Top Bottom