excel vba alternate active printer

时间:2017-03-21 15:20:32

标签: excel vba excel-vba printing

我办公室的某些人使用Bluebeam程序打印,有些人使用默认的Adobe PDF打印。我有一个宏默认打印到Bluebeam,而On Error GoTo用于Adobe,但它似乎无法正常工作。

我还试过On Error Goto ... SendKeys "^{F2}"

Sub PrintPDF()
Application.ScreenUpdating = False

Dim filename As String
On Error GoTo whoa

ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, ActivePrinter:="Bluebeam PDF"
filename = Range("B2").Value
Exit Sub
whoa:
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, ActivePrinter:="Adobe PDF"
Application.ScreenUpdating = True
End Sub

0 个答案:

没有答案