seanjon
New Member
- Joined
- Dec 23, 2017
- Messages
- 12
Good day.
A workbook I have has 22 worksheets. I want pages 1&2, 3&4, 5&6, etc. to print both sides. I have a color printer on the network that is not my default printer. I made a command button that will send the workbook to the color printer. I also want it to print it duplex.
This is what I have for the button so far. It works and sends the workbook to that printer.
Through searching, I know that there is a code to set it to duplex:
Where should I put this in the code for my command button, or is there something different I need to put in the sub?
Thanks for your time.
Sean
A workbook I have has 22 worksheets. I want pages 1&2, 3&4, 5&6, etc. to print both sides. I have a color printer on the network that is not my default printer. I made a command button that will send the workbook to the color printer. I also want it to print it duplex.
This is what I have for the button so far. It works and sends the workbook to that printer.
Code:
Private Sub CommandButton1_Click()
Dim sCurrentPrinter As String
Const MyPrinter As String = "\\vm-print\MARS_BROTHERMFC-9460CDN on Ne06:"
sCurrentPrinter = Application.ActivePrinter
Application.ActivePrinter = MyPrinter
ActiveWorkbook.PrintOut From:=1, To:=22, Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Application.ActivePrinter = sCurrentPrinter
End Sub
Through searching, I know that there is a code to set it to duplex:
Code:
Sub SetPrinterToDuplex()
SetPrinterDuplex "\\vm-print\MARS_BROTHERMFC-9460CDN on Ne06:", 2
End Sub
Where should I put this in the code for my command button, or is there something different I need to put in the sub?
Thanks for your time.
Sean