Send Report using email

M

MikeS

I have a module setup to email reports from my program. The code is as
follows:

Public strReportName As String
Public strTitleName As String

Function Mal_Lab_Report()
On Error GoTo Err_Mal_Lab_Report
Dim MyDate As String
Dim strRec As String

MyDate = Format(Now(), "mm/dd/yyyy")
strRec = "[email protected]"
DoCmd.SendObject acSendReport, strReportName, acFormatHTML, strRec, , , _
"Mal " & strTitleName & " - " & MyDate, , False

Exit_Mal_Lab_Report:
Exit Function

Err_Mal_Lab_Report:
MsgBox Err.Description
Resume Exit_Mal_Lab_Report

End Function

The first few times I ran this it worked perfectly with the report in the
body of the email. However, something has changed and it now shows up as an
Excel attachment.

Can anyone explain this?

Thanks in advance.

MikeS
 
Top