Choose a printer

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi!!

I use this
Range("print!a1:n71").PrintOut

And the range be printet thats ok
but how can i make it so i can choose a printer before printing

Best regards
Alvin
 
If you know the name of the printer, you can set this property:

curPrinter= application.ActivePrinter
Application.ActivePrinter = <desired printer>
....after printing, reset to original printer
application.ActivePrinter = curPrinter

If you don't know the name of the desired printer, you'd need to enumerate
the printers available(investigate the Windows EnumPrinters API) and offer
users a means of selecting the appropriate printer.
 
Hi Alvin

Someting along these lines.

Sub ChoosePrinter()
'Leo Heuser 11-3-2005
Dim ActPrinter As String
Dim Answer As Boolean

With Application
ActPrinter = .ActivePrinter
Answer = .Dialogs(xlDialogPrinterSetup).Show
End With

If Answer = False Then
Exit Sub
Else
'Printout here
End If

Application.ActivePrinter = ActPrinter

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top