Stuart McLachlan
stuart at lexacorp.com.pg
Wed Feb 2 23:40:37 CST 2005
On 2 Feb 2005 at 23:30, Jeff Barrows wrote: > Does anyone know of a way to email an Access report in PDF format using > DoCmd.SendObjects? > SendObjects in MS Access only sends Access Objects. For emailing PDF reports, I use my own utility MailPDF. Here's the sample code on my MakePDF/MailPDF page on my website http://www.lexacorp.com.pg under the Free Software button: <quote> MS Access and MailPDF 1. Design a report ("MyReport") and configure it to "print to a specific printer" - specifically, the printer set up for MakePDF to print to a specific file. Create a Form with a text field to enter the email address (txtAddress) and a command button (cmdSend) and place the following code in the on_click event: cmdSend_click() DIM strShellstring as string DoCmd.OpenReport "MyReport" strShellstring = Chr$(34) & "C:\Program Files\Makepdf\Mailpdf.exe" & Chr$(34) & " /N " _ & txtAddress & " /I C:\Windows\Desktop\Pscript.psf" & Chr$(34) _ & " /O C:\MyReport /S Attached Report /B Here is the report you wanted" Shell (strShellstring) End Sub Clicking the button will print the report, convert it to PDF and send it to the specified address. </quote> -- Stuart