Printing a File

How can I print a File in Hard disk, from VB environment??
Any sample code ???
Thanx
anilkumarvAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
watyConnect With a Mentor Commented:
nFile = FreeFile
Open sFile For Input Access Read As #nFile
sLine = ""
Do While EOF(nFile) = False
   Line Input #nFile, sLine
   Printer.Print sLine
Loop
Close #nFile
Printer.EndDocument
0
 
re03589jCommented:
Another way, you can use a printer driver called PDFPrinter. This printer driver has a free version in internet. You can print everything (text, graphics...) in a file: a file name is asked for when you print to this driver.
0
 
fulscherCommented:
re03589j,

could you provide more info about the "PDFprinter" (I'd be willing to spend some points)

Thanks

0
 
anilkumarvAuthor Commented:
Thanx
0
 
Renato102098Commented:
Ud. puede definir en configuración de la impresora, entrar en propiedades, luego en detalle seleccionar el puerto de la impresora "file" en vez de lpt1 ...
Puede hacer una copia del controlador de la impresora y tener uno en lpt1 y otro en file, en el momento de la impresión se le preguntará el nombre de archivo que desea generar.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.