how to send a .txt file to a printer

remya1000

Well-known member
Joined
Mar 29, 2007
Messages
122
Programming Experience
Beginner
how to send a .txt file to a printer.
after creating a .txt file i need to send that .txt file to a printer.using vb.net
and while sending that file to printer i need to tell, which printer i need to send.
and i can't used printdialog, to select to which printer i need to send and number of pages and all.
everything i need to hardcode. after creating a .txt file, hardcode to which printer i need to send the data and just send to printer.
anyidea how to do this. if you have anyidea, please let me know.
and if you can send an example, that will be great helpfull to me.
thanks in advance.
 
I would recommend the TextPrint class, see thread, one of the benefits is it inherits the .Net PrintDocument so if you don't want to use the default printer you can just set a different like this before calling Print:
VB.NET:
tp.PrinterSettings.PrinterName = "the printer name"
 
heay... its working.... i can give my printer name by using the code you gave.

tp.PrinterSettings.PrinterName = "the printer name"

thanks for your help.
 
Back
Top