Create PDF file and Email as Attachment

G

Guest

I'm trying to create a PDF file as an attachment to an automated Email from
Access reports. My current process is to select the report to print. Print it
to the PDF writer (aka printer). Save the PDF file as a specific name
(includes Rec. ID and date) AND in a specific location (current db location)
that I define. Get that file and include it in my email as an attachment.

The only thing I can't seem to find a way to do is to create the PDF with a
name I define (without letting the user interfere with the convention I set
up). If I use "outputto" it wants a file type that's in it's list like snap
or rtf ...etc. And "printout" doesn't let me define my file name.

Help!?
 
M

Mark Andrews

We make a module you put in your database with a few functions for creating
pdf files
from code. Example:
Result = RPT_CreateSingleFile("rptExample",
"C:\Reports\Report1.pdf","PDF","WHERE Salary > 50000")

would create a pdf file by running rptExample and passing in where criteria.

We also have ways to automate large quantities of pdf file creation.
Send me an email using the support email address if you have any questions.

Download the eval and try it out,
Mark
RPT Software
http://www.rptsoftware.com
 
G

Guest

I am using CutePDF because ..well..we're cheap. I need the code to save the
PDF with a name and location that I have defined ("where" criteria that you
mentioned is previously defined when creating the report to print). Do you
have similar code for writing file names available Free?
 
M

Mark Andrews

Sorry not free. If you go with free products you usually have to spend
time. I guess calculate how much you make an hour and how long it will take
you to build the system and then determine if you should buy our product.

You do get full source code with our product.

Mark
 
G

Guest

I use the following code in a module (you have too have CutePDF loaded) and
then have a button on the menu bar that's linked to it ... hope it's what
your looking for
Function ConvertPDF()
Dim PDFPrinter As Printer
Set PDFPrinter = Application.Printer
Application.Printer = Application.Printers("CutePDF Writer")
On Error Resume Next
Dim strReportName As String
strReportName = Screen.ActiveReport.Name
DoCmd.SelectObject acReport, strReportName
DoCmd.PrintOut acPrintAll
Application.Printer = Application.Printers(0)
End Function
Cheers
 

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