PDA

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



Eric
09-03-2013, 09:54 PM
I had a macro in excel 2007 that worked with adobe 8 but now have adobe 10 which the macro will find the drawings I need from a list which would print out all the prints using adobe 8 but has stopped when adobe 10 was installed . The computer was also changed from XP to Windows 7 . so what do I have to change to get adobe to print the drawings out ,The same printer is used as my default printer and works fine if printed out one page at a time but adobe 10 will not sent to the printer queue but saves as a list of recent pages on the front screen as a list for about 80 drawings which could then be printed out one at a time but that is not the purpose of the macro ( time wasted) .

Excel Fox
09-03-2013, 10:42 PM
Eric, could you post your existing code here?

Eric
09-03-2013, 11:00 PM
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