Automate the emailing of a report within Access

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
 
A

Ayelet

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top