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
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
相关文章推荐
- VBA outlook实战#01--自动回复邮件
- 2016年2月22号工作日记
- vbird笔记2016-02-21
- 【VB.NET】实现动态托盘图标
- 【VB.NET】获取文件版本信息
- VBA的一个文本文件操作类
- VBA:文本文件编码互换
- 【VB.net】——整体总结
- vbird笔记2016-02-19
- VBA单元格拷贝
- 用vbs写的自动保存小工具
- 【VB.NET】获取机器名称和IP地址
- vbird笔记2016-02-18
- VB6.0 excel 导入和导出
- 关于 VBA 部分
- 【VBA】批量插入图片
- 【VB.NET】——方法重载和方法重写的区别
- vb计算溢出问题
- win7上使用vb鼠标滚动
- setbuf、setvbuf