VB6 shell 打印

来源:互联网 发布:北京金山软件 编辑:程序博客网 时间:2024/05/18 03:59
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

Const SW_SHOW = 5

Private Sub Form_Load()

End Sub

Private Sub Print_Click()
Dim ret As Integer

    ret = ShellExecute(Me.hwnd, "print", "c:\temp\np.xls", "", "", SW_SHOW)

    Text1.Text = "Print Finished with return " + Str(ret)
End Sub
0 0
原创粉丝点击