• Print to multiple .pdf files in VBA (2002)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Print to multiple .pdf files in VBA (2002)

    Author
    Topic
    #429409

    I need to print 15-30 different reports to .pdf at a time (they are currently exported in .rtf format). I can change the default printer to my Adobe driver, but I am prompted for a .pdf file name. Is there a way to pass the file name via VBA for each file? I’ve seen some examples which require modifying the Windows registry, but I didn’t see a feature in Access that will allow this?

    Is there a (relatively) easy answer to this?

    Thanks!

    Larry

    Viewing 2 reply threads
    Author
    Replies
    • #999991

      Could you use snapshot format? That always seems the easiest format to use for Access reports and would allow you to simply modify your *.RTF export code.

    • #1000001

      No, as far as I know there is no easy way.

      • #1000122

        Any suggestions for third party software for Access VBA to write the Windows Regristry?

        • #1000126

          You don’t need 3rd party software; you can use the code from post 322,094.

          • #1000164

            Hans,

            Thanks – a question about PrintOut – how do I apply this to a report? I usually use docmd.openreport, but docmd.printout does not allow me to specify the report to print.

            Thanks again!

            Larry

            • #1000170

              You must either open the report in preview mode using DoCmd.OpenReport with acViewPreview as 2nd argument, or (less attractive in an end-user database) select it in the database window using DoCmd.SelectObject with True as InDatabaseWindow argument.

            • #1000178

              Edited by HansV to make URL clickable – it’s very easy and MUCH more user-friendly. See Help 19

              Hi All,
              I have been using the code from here: http://www.mvps.org/access/reports/rpt0011.htm%5B/url%5D to generate PDFs of access reports for a while now. I also output as many as 4 pdf’s with different names / locations without problems. You basically put these modules in your DB and run it.

              Thanks,
              Mark

    • #1000017

      Do you need to control the naming of the pdf files?

      Have a look at PDF995 and PDFFactory, these give you option for creating PDF files and some control over the naming.

    Viewing 2 reply threads
    Reply To: Print to multiple .pdf files in VBA (2002)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: