Reply

Join Date: Dec 2007
Posts: 29
Reputation: jem00 is an unknown quantity at this point 
Solved Threads: 1
jem00 jem00 is offline Offline
Light Poster

Printing in VB

 
0
  #1
Jul 3rd, 2009
How do I print a particular label or textbox in visual basic?

By printing, I am referring to the actual hardcopy that comes out of a printer...haha

Thanks for your help.

Jem00
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 784
Reputation: vb5prgrmr will become famous soon enough vb5prgrmr will become famous soon enough 
Solved Threads: 139
vb5prgrmr vb5prgrmr is offline Offline
Master Poster

Re: Printing in VB

 
0
  #2
Jul 3rd, 2009
The simple answer is...
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Printer.Print Text1.Text


Good Luck
If anyone has helped you solve your problem, please mark your thread as solved.

Thanks
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 29
Reputation: jem00 is an unknown quantity at this point 
Solved Threads: 1
jem00 jem00 is offline Offline
Light Poster

Re: Printing in VB

 
0
  #3
Jul 4th, 2009
haha so easy, yet soo sought after.

Thanks.

One more question, if there are multiple printers avaliable how can I select which one to print from?
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 784
Reputation: vb5prgrmr will become famous soon enough vb5prgrmr will become famous soon enough 
Solved Threads: 139
vb5prgrmr vb5prgrmr is offline Offline
Master Poster

Re: Printing in VB

 
0
  #4
Jul 4th, 2009
A couple of ways...
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Dim P As Printer
  2.  
  3. Debug.Print Printer.DeviceName
  4.  
  5. For Each P In Printers
  6. Debug.Print P.DeviceName
  7. If P.DeviceName = "The Name of the printer" Then
  8. Set Printer = P
  9. Exit For
  10. End If
  11. Next P
  12.  
  13. Debug.Print Printer.DeviceName
or by using the common dialog control
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Debug.Print Printer.DeviceName
  2.  
  3. CD.ShowPrinter
  4.  
  5. Debug.Print Printer.DeviceName

Good Luck
If anyone has helped you solve your problem, please mark your thread as solved.

Thanks
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC