Alguien sabe como puedo imprimir un TXT desde una aplicación de VB ...
digo, me refiero a algo que solo le pase como parametro el TXT a imprimir y
listo (como el PRINT del viejo DOS)
Gracias
Luis
saludos
ASMER
"Luis Freites" <luisf...@hotmail.com> escribió en el mensaje
news:OaqxivcfBHA.392@tkmsftngp02...
Tendrás que usar un DLL/OCX externo que lo haga por ti o leer el archivo e
imprimirlo por código mediante el objeto Printer (método Print).
Además es muy sencillo.
--
Regards,
Eric Garza, MVP
Project manager
AMI GE
"Luis Freites" <luisf...@hotmail.com> wrote in message
news:OaqxivcfBHA.392@tkmsftngp02...
Prueba con esto:
Private Sub Command1_Click()
Dim nFileHandle As Integer
Dim sLine As String
nFileHandle = FreeFile
'Cambia el nombre del archivo por el que necesites...
Open "SMS.INI" For Input As #nFileHandle
Do While Not EOF(nFileHandle)
Line Input #nFileHandle, sLine
Printer.Print sLine
Loop
Close #nFileHandle
Printer.EndDoc
End Sub
Te sugiero que revises mensajes anteriores, esto ya se ha
publicado muchas veces. Hay que buscar, antes de
preguntar !!!
Private Declare Function ShellExecute Lib "shell32.dll" Alias
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal
lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String,
ByVal nShowCmd As Long) As Long
Const SW_HIDE = 0
Dim hProc As Long
hProc = ShellExecute(Me.hwnd, "Print", "C:\MiDir\Archivo.txt", "", App.Path,
SW_HIDE)
Espero que te sirva,
Mindeye
"Luis Freites" <luisf...@hotmail.com> escribió en el mensaje
news:OaqxivcfBHA.392@tkmsftngp02...