ABRIR UN ARCHIVO *.TXT DESDE VB
Publicado por NESTOR (94 intervenciones) el 30/08/2006 01:02:36
Hola amigos!!!!
Cómo están????
Tengo un archivo *.txt, el cual lo necesito abrir desde mi aplicación. Estoy utilizando el siguinete código.
Con este código me abre perfectamente los archivos de word, excel, power point. Pero no me abre los archivos con extension *.txt
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
Private Sub Command1_Click()
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists("c:\formulario.txt") Then
lresult = ShellExecute(Me.hwnd, "open", "c:\formulario.txt", "", 0, SW_SHOWNORMAL)
End If
End Sub
Necesito que su valiosa ayuda...muchas gracias de antemano!!!!!!
Cómo están????
Tengo un archivo *.txt, el cual lo necesito abrir desde mi aplicación. Estoy utilizando el siguinete código.
Con este código me abre perfectamente los archivos de word, excel, power point. Pero no me abre los archivos con extension *.txt
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
Private Sub Command1_Click()
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists("c:\formulario.txt") Then
lresult = ShellExecute(Me.hwnd, "open", "c:\formulario.txt", "", 0, SW_SHOWNORMAL)
End If
End Sub
Necesito que su valiosa ayuda...muchas gracias de antemano!!!!!!
Valora esta pregunta


0