question911
MIS
I am using the Shell API to attempt to print a MS Word Document without having MS Word opened. However, this Shell API always opens MS Word in order to print the document. What am I missing here?
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpszOp As String, _
ByVal lpszFile As String, ByVal lpszParams As String, _
ByVal LpszDir As String, ByVal FsShowCmd As Long) _
As Long
Private Sub Form_Load()
Dim StartPrint As Long
Dim FileToPrint As String
FileToPrint = "D:\Data\test.doc"
StartPrint = ShellExecute(Me.hwnd, "open", FileToPrint, ByVal 0&, ByVal 0&, SH_HIDE)
End Sub
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpszOp As String, _
ByVal lpszFile As String, ByVal lpszParams As String, _
ByVal LpszDir As String, ByVal FsShowCmd As Long) _
As Long
Private Sub Form_Load()
Dim StartPrint As Long
Dim FileToPrint As String
FileToPrint = "D:\Data\test.doc"
StartPrint = ShellExecute(Me.hwnd, "open", FileToPrint, ByVal 0&, ByVal 0&, SH_HIDE)
End Sub