Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert text into email via Override Send To Mail Recipient ?

Status
Not open for further replies.

MrPeds

Programmer
Jan 7, 2003
219
GB
Hi,

I have a database written in Access XP and have produced a simple report that is created dynamically when a button on a form is pressed.

I know that it is possible to send an email of the Report using the tool bar option called 'Send To Mail Recipient' when you are previewing the report.

I would like to know if it is possible to insert the Subject, and some body text into the email, perhaps using some values from the report or alternatively insert some generic text based on the report name. (I can send emails manually in code but simply want to insert the text into the opened email pane).

I would like to use the exisiting Access button option as it is straight forward to the user (and they may have used it in MS Word and Excel so may be familiar to them).

Any advice would be appreciated.

Thanks.

MrPeds
 
you might could use the DoCmd.SendObject Method. do a search in access help, it has an explanation and example of how to fill in an e-mail message.
 
Here is the code for email. Put this behind a button on the form. The Me![emailto], Mw![emailbcc].... names refer to fields on the active form. The TRUE parameter will open up the email message and not send it. False sends automatically.

DoCmd.Sendobject acReport, "reportname", _
"SnapshotFormat(*.snp)", Me![emailto],Me![emailcc],Me![emailbcc],Me![subject],Me![text], True, ""

Good Luck
Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top