print a pdf documnet inside a folder

Aug 18 2008 10:11 AM

any one who can help

Private Sub PrintDoc(ByVal fullPath As String)

Try

Dim pathToExecutable As String = "C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe"

Dim sReport = fullPath.ToString 'Complete name/path of PDF file

Dim SPrinter = "HP LaserJet 5100 tn" 'Name Of printer

Dim starter As New ProcessStartInfo(pathToExecutable, "/t """ + sReport + """ """ + SPrinter + """")

Dim Process As New Process()

Process.StartInfo.CreateNoWindow = True

 Process.StartInfo.FileName = "C:\Stands.pdf"

 

Process.StartInfo = starter

Process.Start()

Process.WaitForExit(10000)

'Process.Kill()

Process.Close()

Catch e As Exception

AppendToLogFile("Error in Printing " & e.Message)

End Try

End Sub 'PrintDoc