|
Declare PtrSafe Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpszOp As String, _
ByVal lpszFile As String, ByVal lpszParams As String, _
ByVal LpszDir As String, ByVal FsShowCmd As Long) _
As Long
Sub 批量打印PDF文件()
Application.ScreenUpdating = False
Dim i As Integer, sFile As String
Set mydialog = Application.FileDialog(msoFileDialogFilePicker)
With mydialog
.Filters.Clear '清除所有文件筛选器中的项目
.Filters.Add "所有PDF文件", "*.pdf", 1 '增加筛选器的项目为所有pdf文件
.AllowMultiSelect = True '允许多项选择
.Show
If .SelectedItems.Count = 0 Then
Exit Sub
End If
For i = 1 To .SelectedItems.Count
sFile = .SelectedItems(i)
ShellExecute Application.hwnd, "print", sFile, "", "", SW_HIDE
Next
End With
Application.ScreenUpdating = True
End Sub
|
评分
-
2
查看全部评分
-
|