Click here to Skip to main content
15,867,704 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Two printer has been installed in my computer. one in USB port (laserjet), another one is in LPT1 (dot matrix). I have created reports in crystal report 8.5 and printing them using vb 6.0 code. my reports has been set to LPT printer in crystal report design mode. when printing using code it always goto default printer (laserjet) in windows 7.

could we have 2 printer and set whichever report to whichever printer and print using vb 6.0 code without mentioning port and printer name in code.?

should we change the default printer via code when we print.?
Posted

1 solution

I'm not convinced that you can do it without at least mentioning the printer name but you can temporarily change the default printer ...

I found a solution here[^] that seems to work and by all accounts so does this one http://bytes.com/topic/visual-basic/answers/573220-print-user-selected-printer-without-changing-default[^]

They both use the printer name however.

MS suggest using the following http://msdn.microsoft.com/en-us/library/aa227597(v=vs.60).aspx[^] ... using the dialog gives the users the choice of printer
 
Share this answer
 
Comments
Maciej Los 20-Sep-13 16:11pm    
Sounds reasonable ;)
CHill60 20-Sep-13 16:17pm    
Me ... I make the users select the printer ... that way if it comes out wrong it's their fault! :-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900