ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Choose a printer (https://www.excelbanter.com/excel-programming/325123-choose-printer.html)

Alvin Hansen[_2_]

Choose a printer
 
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


AA2e72E

Choose a printer
 
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.

"Alvin Hansen" wrote:

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


Leo Heuser[_3_]

Choose a 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

--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"Alvin Hansen" skrev i en meddelelse
...
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




Alvin Hansen[_2_]

Choose a printer
 
Thanks Leo

Its working

Regards Alvin


"Leo Heuser" skrev:

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

--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"Alvin Hansen" skrev i en meddelelse
...
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





Leo Heuser[_3_]

Choose a printer
 
You're welcome, Alvin.
Thanks for the feedback :-)

--
Best Regards
LeoH


"Alvin Hansen" skrev i en meddelelse
...
Thanks Leo

Its working

Regards Alvin





All times are GMT +1. The time now is 07:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com