打印时如何启用订书机?

我试图从Excel中打印一个Word文档。

这工作,除了我需要启用这个打印工作的订书机。

我的打印机,施乐工作中心5755,可以在左上angular放置一个或两个订书钉。

Excel显然可以pipe理这个,我不需要进入打印机驱动程序属性来启用装订,我可以直接从文件打印页面启用。

当我进入这个页面时,在“设置”下面有一个用订书机符号写下的“无订书钉”的下拉框。

如果点击它,我可以select“无订书钉”,“左上方钉书针”和“左上方的两个订书钉”以及其他灰色的选项。

我试着录制一张macros,用左上方的钉书钉和双面打印进行打印。

这是它给我的。

ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _ IgnorePrintAreas:=False 

这既不装订也不双面打印。

我读了这个主题的多个线程,但他们都是老,并没有真正回答这个问题,因为在所有情况下,提问者需要更改属性中的驱动程序设置,所以不是我的情况。 我有一台打印机,可以使订书机的function更好。

不过,我不得不求助于我find的答案之一,那就是使用sendkeys,这是非常不可靠的。

这是我的代码看起来像。

 Sub PrintChecklist() Dim myprinter As String Dim PrintersList() As String Dim printer_name As String Dim x As Long Dim wordapp As Word.Application Dim CBC As CommandBarControl Set wordapp = CreateObject("word.Application") wordapp.Documents.Open "C:\Users\XXXXX\Desktop\pool3.doc" wordapp.Visible = True myprinter = Application.ActivePrinter wordapp.WindowState = wdWindowStateMaximize PrintersList() = GetPrinterFullNames For x = 1 To UBound(PrintersList) If InStr(1, PrintersList(x), "MYPRINTERNAME", vbTextCompare) > 0 Then _ printer_name = PrintersList(x) Next x wordapp.ActivePrinter = printer_name DoEvents wordapp.Application.Activate ' only works in only one word opened Dim lRet As Long lRet = FindWindow("OpusApp", vbNullString) SetForegroundWindow lRet On Error Resume Next Set CBC = Application.VBE.CommandBars.FindControl(ID:=752) On Error GoTo 0 If Not CBC Is Nothing Then CBC.Execute DoEvents '~~> File --> Print SendKeys "%fp" Sleep 3000 SendKeys "k" Sleep 100 SendKeys "{DOWN}" Sleep 100 SendKeys "~" Sleep 100 SendKeys "%fp" Sleep 100 Sleep 1000 SendKeys "s" SendKeys "3-5,1-2" SendKeys "%fp" Sleep 1000 SendKeys "d" SendKeys "{DOWN}" SendKeys "~" SendKeys "%fp" Sleep 2000 SendKeys "p" SendKeys "{NUMLOCK}" End If Sleep 5000 wordapp.ActivePrinter = myprinter wordapp.Quit SaveChanges:=wdDoNotSaveChanges End Sub 

它可以工作,但是如果有延迟,或者用户在10秒钟内触摸了任何东西,那么这一切都很快就会出错。

任何build议欢迎!