Automate the emailing of a report within Access

  • Thread starter Thread starter CiryMarr
  • Start date Start date
C

CiryMarr

Hi

I have a requirement to programmatically save an Access Report in Rich Text
Format, and then email this automatically to a single email address.

Can this be achieved easily?

Thanks in advance - please REPLY TO GROUP - NOT TO EMAIL ADDRESS.

Cirym
 
Hi,
Use the DoCmd.SendObject Command from code.
If you need to open the report with certain criteria and
not just open the report, open it first (DoCmd.OpenReport,
with the needed parameters) and send it when it's open.
it should look something like this:
'code start
Dim stDocName,stEmailAddress as string
stDocName = "MyReportName"
stEmailAddress = "(e-mail address removed)"
DoCmd.SendObject acReport, stDocName, acFormatRTF, _
stEmailAddress, , , _
"Your Weekly Report" , _ 'this was your title
"<message body-some text here would be nice. use the
vbCrLf to enter line breaks>"
'code ends
I'm afraid this only works in Ms Outlook (not even outlook
express or anything of the kind). I could be wrong, but i
haven't been able to use any other mailing applications
with this yet.
Good Luck!
Ayelet
 
Back
Top