Results 1 to 3 of 3

Thread: how to get adobe to print multipul pages of list from a list of PDF drawings in excel

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    Eric, could you post your existing code here?
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  2. #2
    Junior Member
    Join Date
    May 2011
    Posts
    2
    Rep Power
    0
    Code:
    Public Sub printDrawings()
    Dim rng As Range, rCt As Long, r As Long, oExec
    Set rng = ActiveSheet.Columns("B")
    rCt = WorksheetFunction.CountA(rng) + 2
    Set objWShell = CreateObject("Wscript.Shell")
    Set oFSO = CreateObject("Scripting.FileSystemObject")
        
    For r = 2 To rCt
        If ActiveSheet.Range("B" & r).Hyperlinks.Count > 0 Then
            If InStr(1, ActiveSheet.Range("B" & r).Hyperlinks(1).Address, ".pdf", vbTextCompare) > 0 Then
                Shell ("C:\Program Files(86x)\Adobe\Reader 10.0\Reader\AcroRd32.exe /t """ & ActiveSheet.Range("B" & r).Hyperlinks(1).Address & """ " & Application.ActivePrinter)
            Else
                Set oExec = objWShell.Exec("rundll32.exe shimgvw.dll,ImageView_PrintTo /pt """ & ActiveSheet.Range("B" & r).Hyperlinks(1).Address & """ " & Excel.ActivePrinter)
                Do While oExec.Status = 0
                Loop
                ' Clean up
                Set oExec = Nothing
            End If
        End If
    Next r
    Set objWShell = Nothing
    End Sub
    Last edited by Eric; 09-04-2013 at 06:57 PM. Reason: Added codetags;No need to quote when directly answering a question.

Similar Threads

  1. Replies: 2
    Last Post: 07-28-2013, 09:29 AM
  2. Replies: 4
    Last Post: 07-27-2013, 01:34 PM
  3. Print excel sheet to a PDF file
    By xander1981 in forum Excel Help
    Replies: 2
    Last Post: 12-14-2012, 02:16 PM
  4. Delete List Contain Matching from Second List
    By Rajan_Verma in forum Rajan Verma's Corner
    Replies: 12
    Last Post: 10-07-2012, 07:18 PM
  5. Replies: 0
    Last Post: 03-06-2012, 03:55 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
  •