![]() |
|
#1
|
|||
|
|||
![]()
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") |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Aviendah | Word | 1 | 10-06-2016 08:36 AM |
![]() |
deesloop | Project | 7 | 07-22-2015 07:52 AM |
![]() |
survivo01 | Word | 4 | 05-22-2014 12:57 AM |
![]() |
terik222 | Word | 3 | 03-27-2013 02:43 PM |
![]() |
anthrax19888 | Word | 1 | 10-12-2009 08:09 AM |