C
Chris
Hi All
I'm having a problem printing PDFs from Access. I've tried using the Adobe
object (SDK) to print them but that doesn't always work.
Instead I tried using the shell command - this works every time but it makes
the Adobe application visible and leaves it open which is a real problem.
Does anyone know how to do this invisibly and close the application
afterwards.
The code I'm using is below.
Cheers
Chris
strFileNameToPrint = gconstr_REPORTS_FILE_PATH_LOCAL & strFileNameToPrint &
".pdf"
strPrinterName = Printer.DeviceName
strDriverName = Printer.DriverName
strPortName = Printer.Port
strCommandLine = "C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe /t
""" + _
strFileNameToPrint + """ """ + _
strPrinterName + """ """ + _
strDriverName + """ """ + _
strPortName + """"
If Not (Shell(strCommandLine, 0) <> 0) Then
rstrError = "There is a problem printing the PDF file : " _
& vbCrLf & vbCrLf & strFileNameToPrint
GoTo printReportPackages_Exit
End If
I'm having a problem printing PDFs from Access. I've tried using the Adobe
object (SDK) to print them but that doesn't always work.
Instead I tried using the shell command - this works every time but it makes
the Adobe application visible and leaves it open which is a real problem.
Does anyone know how to do this invisibly and close the application
afterwards.
The code I'm using is below.
Cheers
Chris
strFileNameToPrint = gconstr_REPORTS_FILE_PATH_LOCAL & strFileNameToPrint &
".pdf"
strPrinterName = Printer.DeviceName
strDriverName = Printer.DriverName
strPortName = Printer.Port
strCommandLine = "C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe /t
""" + _
strFileNameToPrint + """ """ + _
strPrinterName + """ """ + _
strDriverName + """ """ + _
strPortName + """"
If Not (Shell(strCommandLine, 0) <> 0) Then
rstrError = "There is a problem printing the PDF file : " _
& vbCrLf & vbCrLf & strFileNameToPrint
GoTo printReportPackages_Exit
End If