Results 1 to 5 of 5
  1. #1
    togo is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2012
    Posts
    83

    Printing multiple reports into single PDF

    How to do this? trick is that these reports are all the same report being fed different data, opened and closed using VBA. In between the closing and opening the data gets changed. Best approach is?



    thanks

    ps. CutePDF is installed

  2. #2
    togo is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2012
    Posts
    83
    what I have so far is the code from this page

    http://www.access-programmers.co.uk/...d.php?t=194687

    but don't know how to call the function MergeThePDFs, seem to be getting the data type wrong. What's an example of how to call that function putting in the strings for each file I want to combine?

  3. #3
    togo is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2012
    Posts
    83
    also the above function requires you to have the $200 version of adobe professional installed

  4. #4
    togo is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2012
    Posts
    83
    Yes I am still in trouble and need help!

    Code:
    Dim AcroApp As Acrobat.CAcroApp
        
    Dim Part1Document As Acrobat.CAcroPDDoc
    Dim Part2Document As Acrobat.CAcroPDDoc
        
    Dim numPages As Integer
        
    Set AcroApp = CreateObject("AcroExch.App")
        
    Set Part1Document = CreateObject("AcroExch.PDDoc")
    Set Part2Document = CreateObject("AcroExch.PDDoc")
         
    Part1Document.Open ("c:\MPI1.pdf")
    Part2Document.Open ("C:\MPI2.pdf")
        
    ' Insert the pages of Part2 after the end of Part1
    numPages = Part1Document.GetNumPages()
    MsgBox numPages
    If Part1Document.InsertPages(numPages - 1, Part2Document, 0, Part2Document.GetNumPages(), True) = False Then
        MsgBox "Cannot insert pages"
    End If
         
    If Part1Document.Save(PDSaveFull, "C:\MergedFile.pdf") = False Then
        MsgBox "Cannot save the modified document"
    End If
            
    Part1Document.Close
    Part2Document.Close
         
    AcroApp.Exit
    Set AcroApp = Nothing
    Set Part1Document = Nothing
    Set Part2Document = Nothing
    I installed Adobe Trial and the libraries seem to load properly the code doesn't crash, but it says "-1" for number of pages... when in fact "MPI1.pdf" has 2 pages.

  5. #5
    togo is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2012
    Posts
    83
    Nevermind, was looking in the wrong directory :/ issue solved, code works perfectly

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Help printing off multiple reports.
    By MelonFuel in forum Forms
    Replies: 5
    Last Post: 06-29-2012, 12:25 PM
  2. Multiple Reports to Single PDF
    By hkimpact in forum Access
    Replies: 1
    Last Post: 06-11-2012, 03:17 PM
  3. Printing multiple reports for one record
    By brew in forum Programming
    Replies: 3
    Last Post: 11-18-2011, 10:01 AM
  4. Replies: 3
    Last Post: 05-23-2011, 01:52 PM
  5. Printing multiple reports with one command
    By AKQTS in forum Reports
    Replies: 2
    Last Post: 09-24-2010, 09:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums