[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 171
  • Last Modified:

Printing a File

How can I print a File in Hard disk, from VB environment??
Any sample code ???
Thanx
0
anilkumarv
Asked:
anilkumarv
1 Solution
 
watyCommented:
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

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now