Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > One button - one printer


Reply
 
Thread Tools Display Modes
  #1  
Old 11-15-2003, 08:35 AM
coutts coutts is offline
Junior Contributor
 
Join Date: Aug 2003
Location: PEI, Canada
Posts: 235
Default One button - one printer


I have searched the forum for information on this subject and I did find a few threads about it - but the answers were tied up with more complex things the questioners were trying to do and I havent been able to separate what I need from the answers, so I'll ask:

I have 2 printers, one called Printer1, the other Printer2. I have two buttons on a form, the idea is press one and the information will be printered by Printer1, or press 2 and likewise the info goes to Printer2.

Could anyone enlighten me about the simplest way to do this.

Much Appreciated
Robert
Reply With Quote
  #2  
Old 11-15-2003, 08:57 AM
reboot's Avatar
reboot reboot is offline
Keeper of foo

Retired Moderator
* Guru *
 
Join Date: Nov 2001
Location: Graceland
Posts: 15,612
Default

__________________
~ Quod non mortiferum, fortiorem me facit ~

Avatar by lebb
Reply With Quote
  #3  
Old 11-15-2003, 08:59 AM
Jamesanthony's Avatar
Jamesanthony Jamesanthony is offline
Contributor
 
Join Date: May 2003
Location: Dublin
Posts: 502
Default Printers

I use componentone VSPrinter control to print(Download a sample component from componentone.com)
This works for me
VSReport1.Render VSPrinter1
sub button1_Click
VSPrinter1.Device = "CopyRemChqPrt"
VSPrinter1.PrintDoc
end sub
sub button2_Click
VSPrinter1.Device = "CopyRemChqPrt1"
VSPrinter1.PrintDoc
end sub
Reply With Quote
  #4  
Old 11-15-2003, 09:40 AM
coutts coutts is offline
Junior Contributor
 
Join Date: Aug 2003
Location: PEI, Canada
Posts: 235
Default

Thank You to those who have provided possible answers to my question. I perhaps should clarify a bit. I'm not actually trying to change the default printer. The information under the Microsoft link is about calling all the printers that you have attached and allowing the user to choose the default. In the situation I find here, I know which printer goes with which operation. If I put a commondialog on I could let them choose the printer they wanted that way, but thats too timeconsuming for the situation and the people would get it wrong. I'm really looking for a way where the correct printer for the operation is specified in the print code. Ie Print this using that printer
Thanks
Reply With Quote
  #5  
Old 11-15-2003, 09:46 AM
reboot's Avatar
reboot reboot is offline
Keeper of foo

Retired Moderator
* Guru *
 
Join Date: Nov 2001
Location: Graceland
Posts: 15,612
Default

That code I gave you the link to will do that. Simply change the default printer to the printer you want and print. Then change it back if you don't want the default printer changed. It shows how to do all that.
__________________
~ Quod non mortiferum, fortiorem me facit ~

Avatar by lebb
Reply With Quote
  #6  
Old 11-15-2003, 10:57 AM
coutts coutts is offline
Junior Contributor
 
Join Date: Aug 2003
Location: PEI, Canada
Posts: 235
Default

I can see that indeed that code would change the default printer which would result in print job going to the new defualt. But -

Well, I'll try a new question, sort of:

Is there a way to send a print job to a printer that is not the default printer (and with out changing the default printer) without using a commondialog. I have seen similar questions here and it looks like


Code:
Private Sub Command1_Click Dim Printer1 As Printer Dim Printer2 As Printer Set Printer = Printer2 Printer.Print 'whatever End Sub

Now if Printer1 happens to be the default printer (and without changing it as default) would this print job go to Printer2. If it doesnt is there another way of achieving this in a similar way specifying the printer you want without changing the default

Thanks
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal reports won't accept change to default printer skinny monkey Database and Reporting 1 11-13-2003 02:08 AM
Tricky code... Mystical_Moon General 12 10-28-2003 03:42 PM
Adding Button to Titlebar alehawk General 0 08-29-2003 11:12 AM
disabling the Print Form Button scottxx69xx General 1 02-19-2003 08:42 PM
CAN SOMEONE TELL ME HOW TO????? Bunkey23 General 6 11-24-2000 01:37 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->