Courtesy of Hans:
Try using ShellExecute:
Put the following declarations at the beginning of a module:
Private Declare Function ShellExecute Lib “shell32.dll” Alias “ShellExecuteA” _
(ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Private Const SW_SHOWNORMAL = 1
Public Sub PrintPDF(fn As String)
Dim lngResult As Long
lngResult = ShellExecute(0&, “Print”, fn, 0&, 0&, SW_SHOWNORMAL)
If lngResult <= 32 Then
MsgBox "Something went wrong.", vbExclamation
End If
End Sub
To print test.pdf, use
Call PrintPDF("test.pdf")
or
Dim fn As String
fn = "test.pdf"
Call PrintPDF(fn)