I am in the process of converting macros in Access 2000 databases to VBA code for use in Access 2007. The macros open reports which are formatted to go to the Adobe PDF printer using the print command. The converted macro VBA code only opens the report in normal view and the user has to go to the Office Button and save the file as a PDF file. The original macro automated this process for 45 consecutive reports. I need to modify or add to the new VBA code so that it automates this process by outputing the file to PDF format (without opening the file) and prompts the user for the location to save the PDF file. I need assistance in writing the VBA code to automate the output of the reports so that all the user has to respond to is a prompt for the file location to save the PDF file (as before with the macro). The following code is from the macro to VBA conversion process -
DoCmd.OpenRepor t "rptmyrepor t", acViewNormal, " ", " "
The report (each report) opens and the user has to go to the Office button, Save As PDF, specify the location, then close the report. This is overwhelming for someone do this process for 45 reports at a time.
I think I have part of the code necessary to output to a PDF file; see below -
DoCmd.OutputTo acReport, "rptmyrepor t", acFormatPDF, " ", "False"
Is this correct and is this the only line of code that I need? I am using Access 2007 with the Office SP2. I am just learning VBA, mostly by example, and I would appreciate any help or guidance to a tutorial site. Thank you.
Carol
DoCmd.OpenRepor t "rptmyrepor t", acViewNormal, " ", " "
The report (each report) opens and the user has to go to the Office button, Save As PDF, specify the location, then close the report. This is overwhelming for someone do this process for 45 reports at a time.
I think I have part of the code necessary to output to a PDF file; see below -
DoCmd.OutputTo acReport, "rptmyrepor t", acFormatPDF, " ", "False"
Is this correct and is this the only line of code that I need? I am using Access 2007 with the Office SP2. I am just learning VBA, mostly by example, and I would appreciate any help or guidance to a tutorial site. Thank you.
Carol
Comment