Zeroanarchy
Technical User
Does anyone know of a way of opening Acrobat reader, printing a PDF and then closing acrobat reader?
So far I can get it to open the file then print but it stays open.. Does anyone have a better way of doing this?
Private Declare Function ShellExecute Lib "shell32" _
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_HIDE = 0
Private Const SW_SHOWNORMAL As Long = 1
Private Const SW_SHOWMAXIMIZED As Long = 3
Private Const SW_SHOWDEFAULT As Long = 10
Private Const SE_ERR_NOASSOC As Long = 31
Private Sub lblName_Click()
Dim strPath3 As String
strPath3 = [Text1].Value
Call ShellExecute(0&, "print", strPath3, 0&, 0&, SW_HIDE)
End sub
Cheers
ZeroAnarchy
ZeroAnarchy
Experience is a wonderful thing. It enables you to recognize a mistake
when you make it again.
So far I can get it to open the file then print but it stays open.. Does anyone have a better way of doing this?
Private Declare Function ShellExecute Lib "shell32" _
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_HIDE = 0
Private Const SW_SHOWNORMAL As Long = 1
Private Const SW_SHOWMAXIMIZED As Long = 3
Private Const SW_SHOWDEFAULT As Long = 10
Private Const SE_ERR_NOASSOC As Long = 31
Private Sub lblName_Click()
Dim strPath3 As String
strPath3 = [Text1].Value
Call ShellExecute(0&, "print", strPath3, 0&, 0&, SW_HIDE)
End sub
Cheers
ZeroAnarchy
![[afro] [afro] [afro]](/data/assets/smilies/afro.gif)
Experience is a wonderful thing. It enables you to recognize a mistake
when you make it again.