#1
|
|||
|
|||
Print preview and print dialog
Back again,
Still trying to sort out this printing option, When i select File then print, I get the print and print preview dialog, I also get this if I hit CTRL P on the keyboard. But if i use - Application.SendKeys ("^P") in VBA it brings up the format cells dialog. How do I get the print and print preview dialog displayed using VBA ???? |
#2
|
|||
|
|||
I just tried this - Application.CommandBars.ExecuteMso ("PrintPreviewAndPrint")
It does bring up the print and print preview dialog, but the printer I want selected isn't. See code below, it seems to go looking for the default printer, any ideas how i can get around this? Code:
Sub AAA() Application.EnableEvents = False Select Case ActiveSheet.Name Case Is = "Mac Label" Application.ActivePrinter = "\\U2-front-desk\bixolon slp-d420 on Ne05:" Case Is = "Address Label" Application.ActivePrinter = "ZDesigner GK420t on 9100" Case Is = "Repair Labels" Application.ActivePrinter = "\\U2-front-desk\bixolon slp-d420 on Ne05:" Case Is = "Labels" Application.ActivePrinter = "\\U2-front-desk\TSC TTP-346M Pro on Ne06:" Case Else Application.ActivePrinter = "Brother DCP-7065DN Printer on Ne04:" End Select Application.CommandBars.ExecuteMso ("PrintPreviewAndPrint") Application.EnableEvents = True Application.ActivePrinter = "Brother DCP-7065DN Printer on Ne04:" End Sub |
#3
|
|||
|
|||
I did it.
I used this to select the printer then display the print and print preview dialog It changes the active printer, then the command bar exe will show the correct printer i need. Code:
t = Application.Dialogs(xlDialogPrint).Application Application.CommandBars.ExecuteMso ("PrintPreviewAndPrint") |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Print and print preview move graphics | Aviendah | Word | 1 | 10-06-2016 08:36 AM |
Discrepancy between Weeknumber i nOnscreen Gantt Chart and print/print preview | deesloop | Project | 7 | 07-22-2015 07:52 AM |
I cannot get print layout to match print preview | survivo01 | Word | 4 | 05-22-2014 12:57 AM |
Print Layout View Differs from Print Preview & Printed Document | terik222 | Word | 3 | 03-27-2013 02:43 PM |
Print preview and actual print do not match? | anthrax19888 | Word | 1 | 10-12-2009 08:09 AM |