标题:VB如果批量打印pdf文件。
取消只看楼主
xingming022
Rank: 1
等 级:新手上路
帖 子:103
专家分:9
注 册:2015-1-26
结帖率:50%
已结贴  问题点数:20 回复次数:1 
VB如果批量打印pdf文件。
pdf文件放到指定的文件夹里面,如何进行批量打印?
搜索更多相关主题的帖子: VB 批量 打印 pdf 文件 
2019-05-14 09:12
xingming022
Rank: 1
等 级:新手上路
帖 子:103
专家分:9
注 册:2015-1-26
得分:0 
回复 2楼 wufuzhang
找到一个下面的代码,可以连续打印其它格式文件,但excel文件不能连续批量打印。麻烦给指导下。例如有很多excel文件,仅仅只能打印出一个文件。

Private Sub Command3_Click()
    Dim RetVal As Long
    Dim ShExInfo As SHELLEXECUTEINFO
   
    Dim I As Integer
    Dim Mypathname As String
    For I = 0 To List1.ListCount - 1
            Mypathname = List1.List(I)

            With ShExInfo
                .cbSize = Len(ShExInfo)
                .fMask = &H40
                .hwnd = 0
                .lpVerb = "print"
                .lpFile = Mypathname
                .lpParameters = ""
                .lpDirectory = vbNullChar
                .nShow = 0
            End With
            
            RetVal = ShellExecuteEx(ShExInfo)
            
            If RetVal = 0 Then
                Exit Sub
            End If
    Next
End Sub


Public 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
2019-05-15 13:30



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-494719-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.239630 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved