+ Reply to Thread
Results 1 to 4 of 4

VBA Printing Selected Pages from External PDF

  1. #1
    Registered User
    Join Date
    06-12-2012
    Location
    DC
    MS-Off Ver
    Excel 2007
    Posts
    15

    VBA Printing Selected Pages from External PDF

    Good afternoon!

    I have spent the last day or two scouring the web for answer. I have found no shortage of similar questions, but have been unable to find a functional answer.

    Here is my overarching goal:
    To create a button that will print the page numbers (which I have listed in a particular cell) from an external PDF file. The location of this file would be defined with another cell (the loan number). To be really ambitious, I would like to be able to then combine the resulting pdf with two of the worksheets from the file I am working off of.

    System Description
    Running Adobe 9.0 with Excel 2007 on Windows XP

    Here is my problem:
    I have been unable to discover how to print from an external pdf file. I am also unable to determine how to combine pdf files through excel. However, I have been able to successfully print multiple sheets from the same workbook (See: http://msdn.microsoft.com/en-us/libr...ice.11%29.aspx).

    Here are my specific question(s):

    1) How do I print selected pages from an external pdf file and save it so a specified (though variable) location? Preferably this would be done without opening the pdf file, but that is not a dealbreaker.

    2) I would like to combine that with an existing pdf file (which I just printed from the workbook). Is this possible through excel VBA?

    Here is what I've tried/found
    I found this: http://kbase.icbconsulting.com/vba/v...-certain-pages but I am not familiar enough with VBA to figure out what to do with it.

    Thank you so much for your help! Without your contribution of time and expertise this would truly be an insurmountable goal for me.

  2. #2
    Registered User
    Join Date
    06-12-2012
    Location
    DC
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: VBA Printing Selected Pages from External PDF

    I don't quite know what the "bump" policies are here but I still haven't been able to uncover the solution to this one.

    Your help would be so much appreciated!! Thanks

  3. #3
    Registered User
    Join Date
    06-12-2012
    Location
    DC
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: VBA Printing Selected Pages from External PDF

    Still trying to struggle through this one. My only lead appears to be here:
    http://kbase.icbconsulting.com/vba/v...-certain-pages

    Please Login or Register  to view this content.
    Getting a compile error on the "AcroApp As AcroApp" line though, alas!

  4. #4
    Registered User
    Join Date
    06-12-2012
    Location
    DC
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: VBA Printing Selected Pages from External PDF

    Update for anyone searching the forum/web for an answer to this problem.

    After weeks searching the web and poking around this task does not seem achievable. I was able to overcome the compile error by going to Tool -> References and checking the Acrobat box and so I got that last bit of code to run. I had some success with the initial and end pages, though I got some weird results (such as printing off only odd pages, and with the wrong orientation). I didn't try to figure out why because it became clear to me that this code wouldn't work to print pages that were dis-contiguous (i.e. pages 1, 4, 15-20) so I gave up on this route. Upon review of the Adobe coding manual I didn't see a line of code for specific pages, so I don't think there is code for this task.

    Nuts.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1