VB如何将多个EXCEL(每个EXCEL文件中含多页)文件批量打印?
Private Sub Command6_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)
Sleep (1000)
If RetVal = 0 Then
Exit Sub
End If
Next
End Sub
这个代码只能打印出EXCEL文件中第一页。