Visual Basic - Como imprimir a un Archivo de Texto ??

Life is soft - evento anual de software empresarial
 
Vista:

Como imprimir a un Archivo de Texto ??

Publicado por Lucyfer (140 intervenciones) el 19/12/2002 18:25:01
Necesito mandar una impresion a un archivo de texto, linea por linea
y agregarle despues lineas

De antemano gracias por su ayuda

Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Como imprimir a un Archivo de Texto ??

Publicado por Fernando (166 intervenciones) el 19/12/2002 18:49:02
Usa las Instrucciones Open (para abrir un archivo) Put (para agregar la información), Close (para cerrar el archivo) y Get (si queres leer la información)
Una ves abras el archivo con Open, también podes usar la instruccion print para imprimir una linea directo al archivo... seria algo así:
Print #numeroarchivo, "Esto es una linea que se imprimira en el archivo"
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Como imprimir a un Archivo de Texto ??

Publicado por manuel (87 intervenciones) el 19/12/2002 21:36:28
' Use 1 inch margins.
Const TOP_MARGIN = 600 '1440
Const LEFT_MARGIN = 0 '1440
Dim bottom_margin As Single
Dim strRow As String
bottom_margin = Printer.ScaleTop + Printer.ScaleHeight - 1440
Printer.Orientation = vbPRORLandscape
Printer.FontName = "Courier New"
Open App.Path & "\Dir\Texto.txt" For Input Access Read Shared As #9
Do Until EOF(9)
Line Input #9, strRow
Printer.Print strRow (Informacion a Imprimir)
If Printer.CurrentY >= bottom_margin Then
' Start a new page.
Printer.NewPage
Printer.CurrentY = TOP_MARGIN
End If
Loop
Close #9
Printer.Print "*** Fin de Informe ***"
' Finish printing.
Printer.EndDoc
Saludos desde Lima Peru
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar