I'm trying to print a .pdf file using a shell. The printout comes from the default printer, but I would like to do it in the mode without opening Adobe Reader, I would like it to be invisible to the user. I tried to use the "SW_HIDE" variable but at this point the printout does not come out at all. I will be grateful for your help.
My code:
Const SW_SHOWNORMAL = 1
Const SW_HIDE = 0
Option Explicit
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 Sub Command1_Click()
Dim PrintIt As Long
PrintIt = ShellExecute(Me.hwnd, "print", "C:\Test.pdf", "", "", SW_SHOWNORMAL)
'Pdf1.src = "C:\test.pdf"
'Pdf1.printAll
End Sub```