Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

open Acrobat reader print PDF close Acrobat reader

Status
Not open for further replies.

Zeroanarchy

Technical User
Jun 11, 2001
630
AU
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


[afro]ZeroAnarchy
Experience is a wonderful thing. It enables you to recognize a mistake
when you make it again.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top