Link to home
Start Free TrialLog in
Avatar of JanePai
JanePai

asked on

AcroRd32.exe file not found when try to Print a PDF file

Hi :
   The acrobat 6 has been installed in my PC.
   The file  'C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe' can not be found.
   when I ran the fillowing codes, I got 'File not Found' error message.
   
   

 
'This method prints the PDF c:\temp\filetoprint.pdf
Option Explicit ' Force variable declaration
' of an organisation

Sub PrintAPDFUsingTheFreeAcrobatReader()
Dim strCommandLine As String
Dim strPrinterName As String
Dim strDriverName As String
Dim strPortName As String
Dim strFileNameToPrint As String

strFileNameToPrint = "c:\temp\filetoprint.pdf"

strPrinterName = Printer.DeviceName
strDriverName = Printer.DriverName
strPortName = Printer.Port

' Perform some error checking here
strCommandLine = "C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe /t """ + _
strFileNameToPrint + """ """ + _
strPrinterName + """ """ + _
strDriverName + """ """ + _
strPortName + """" 

If (Shell(strCommandLine, vbHide) <> 0)Then
MsgBox "Job has been sent to the printer using the command " + strCommandLine
End If
End Sub


Thanks.
Avatar of antonieraj
antonieraj

Hi Janepai

You have installed Acrobat 6 and was search for Acrobat 5 Reader exe in the machine. The above code for Acrobat Reader 5's

If u have installed Acrobat Reader 6 then the path could be like

"C:\Program Files\Adobe\Acrobat 6.0\Reader\AcroRd32.exe"

If u have installed Acrobat professional then the path could be like

"C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe"

Assuming u have installed programs in C drive only...

ASKER CERTIFIED SOLUTION
Avatar of antonieraj
antonieraj

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial