Results 1 to 9 of 9
  1. #1
    Lounger
    Join Date
    Dec 2005
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Print to multiple .pdf files in VBA (2002)

    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

  2. #2
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Royal Oak, Michigan, USA
    Posts
    255
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print to multiple .pdf files in VBA (2002)

    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.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Print to multiple .pdf files in VBA (2002)

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

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Print to multiple .pdf files in VBA (2002)

    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.

  5. #5
    Lounger
    Join Date
    Dec 2005
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print to multiple .pdf files in VBA (2002)

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

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Print to multiple .pdf files in VBA (2002)

    You don't need 3rd party software; you can use the code from <post:=322,094>post 322,094</post:>.

  7. #7
    Lounger
    Join Date
    Dec 2005
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print to multiple .pdf files in VBA (2002)

    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

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Print to multiple .pdf files in VBA (2002)

    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.

  9. #9
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print to multiple .pdf files in VBA (2002)

    Edited by HansV to make URL clickable - it's very easy and MUCH more user-friendly. See <!help=19>Help 19<!/help>

    Hi All,
    I have been using the code from here: http://www.mvps.org/access/reports/rpt0011.htm 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •