各位前輩:想請問如何將pcl檔案從印表機印出來的問題。目前有一WINAPI的函數,但不知道要如何用?請各位不吝指導。非常感謝!
程式碼如下:
Private Declare Function ShellExecuteAny Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As Any, ByVal lpDirectory As Any, ByVal nShowCmd As Long) As Long
Const SW_SHOWMINNOACTIVE = 7
Sub PrintAnyFile(FileToPrint As String)
On Error GoTo Errhandle
Dim Ret As Long
Ret = ShellExecuteAny(Me.hwnd, "print", FileToPrint, ByVal 0&, ByVal 0&, SW_SHOWMINNOACTIVE)
End Sub
Private Sub cmd_Print_Click()
PrintAnyFile Text1.Text
End Sub
程式碼如下:
Private Declare Function ShellExecuteAny Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As Any, ByVal lpDirectory As Any, ByVal nShowCmd As Long) As Long
Const SW_SHOWMINNOACTIVE = 7
Sub PrintAnyFile(FileToPrint As String)
On Error GoTo Errhandle
Dim Ret As Long
Ret = ShellExecuteAny(Me.hwnd, "print", FileToPrint, ByVal 0&, ByVal 0&, SW_SHOWMINNOACTIVE)
End Sub
Private Sub cmd_Print_Click()
PrintAnyFile Text1.Text
End Sub
文章標籤
全站熱搜
