View Single Post
 
Old 07-21-2020, 02:31 PM
trevorc trevorc is offline Windows 7 32bit Office 2013
Competent Performer
 
Join Date: Jan 2017
Posts: 174
trevorc will become famous soon enoughtrevorc will become famous soon enough
Default

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
Reply With Quote