View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Boog Boog is offline
external usenet poster
 
Posts: 10
Default Setting the active printer

Simon,

Thanks for the response. The problem is not how ActivePrinter is set.

Here is the problem in simplified form.

If I manually go to "Printers and Faxes" and set 'Printer A' as the default
printer and then click a command button with the code:

Private Sub CommandButton1_Click()
Application.ActivePrinter = "Printer B"
ActiveSheet.Printout
End Sub

The computer will print to Printer A, not B. For me to print to Printer B,
I must go back to "Printers and Faxes" and set 'Printer B' as the default.

In other words, setting ActivePrinter doesn't seem to do anything.

Howard

"Simon Lloyd" wrote:


Try this, you can enter the printer name where you see Microsoft fax on
fax, you could use an input box to enter the printer name or something
like that!
Regards,

Simon

Sub PrintToAnotherPrinter()
Dim STDprinter As String
STDprinter = Application.ActivePrinter
Application.ActivePrinter = "microsoft fax on fax:"
' change printer
ActiveSheet.PrintOut
' prints the active sheet
Application.ActivePrinter = STDprinter
' change back to standard printer
End Sub


--
Simon Lloyd
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708
View this thread: http://www.excelforum.com/showthread...hreadid=544525