VB6.0 直接打印 PDF

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

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值