您的位置:首页 > 编程语言 > VB

VB6.0 直接打印 PDF

2016-02-22 10:10 323 查看
Private Declare Function ShellExecuteEx Lib "shell32.dll" Alias "ShellExecuteExA" (lpExecInfo As SHELLEXECUTEINFO) As Long

Private Type SHELLEXECUTEINFO

    cbSize As Long

    fMask As Long

    hwnd As Long

    lpVerb As String

    lpFile As String

    lpParameters As String

    lpDirectory As String

    nShow As Long

    hInstApp As Long

    lpIDList As Long

    lpClass As String

    hkeyClass As Long

    dwHotKey As Long

    hIcon As Long

    hProcess As Long

End Type

Private Sub Command1_Click()

    Dim RetVal As Long

    Dim ShExInfo As SHELLEXECUTEINFO

   

    With ShExInfo

        .cbSize = Len(ShExInfo)

        .fMask = &H40

        .hwnd = 0

        .lpVerb = "print"

        .lpFile = "C:\Users\business47\Desktop\FR-A-126-01周末工作记录单.pdf"

        .lpParameters = ""

        .lpDirectory = vbNullChar

        .nShow = 0

    End With

   

    RetVal = ShellExecuteEx(ShExInfo)

   

    If RetVal = 0 Then

        Exit Sub

    End If

End Sub
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: