Visual Basic - Como abrir un archivo desde VB

Life is soft - evento anual de software empresarial
 
Vista:

Como abrir un archivo desde VB

Publicado por Raul (1 intervención) el 11/05/2009 12:18:11
Hola, he creado un editor de texto parecido al block de notas , me falta poner algo parecido al
Acerca de... o Ayuda , es decir necesito que ese menu me abra un archivo de texto por ejemplo para mostrar algo.

Gracias !
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 abrir un archivo desde VB

Publicado por Rolando Lau (115 intervenciones) el 11/05/2009 17:06:17
PRIMERO DECLARAS

'''''''''''''''''''''''''''''''''''''''''''''''''''''
' Apis para buscar ficheros
Private Declare Function FindClose Lib "kernel32" (ByVal hFindFile As Long) As Long
Private Declare Function FindFirstFile Lib "kernel32" Alias "FindFirstFileA" (ByVal lpFilename As String, lpFindFileData As WIN32_FIND_DATA) As Long
Private Declare Function ShellAbout Lib "shell32.dll" Alias "ShellAboutA" (ByVal hwnd As Long, ByVal szApp As String, ByVal szOtherStuff As String, ByVal hIcon As Long) As Long

Private Const INVALID_HANDLE_VALUE = -1
Private Const MAX_PATH = 260

' UDT para FindFirstFile
Private Type FILETIME
dwLowDateTime As Long
dwHighDateTime As Long
End Type

Private Type WIN32_FIND_DATA
dwFileAttributes As Long
ftCreationTime As FILETIME
ftLastAccessTime As FILETIME
ftLastWriteTime As FILETIME
nFileSizeHigh As Long
nFileSizeLow As Long
dwReserved0 As Long
dwReserved1 As Long
cFileName As String * MAX_PATH
cAlternate As String * 14
End Type

LUEGO :

Ejemplo de como seria en un boton cmdacercade:

Private Sub CmdAcercade_Click()
Call ShellAbout(Me.hwnd, "INSTALADOR", "Copyright 2009, Tecnologia", Me.Icon)
End Sub

y listo...eso es todo

Espero te sirva

saludos

Rolando Lau
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 abrir un archivo desde VB

Publicado por Rolando Lau (115 intervenciones) el 11/05/2009 17:11:48
Me olvidaba para abrir un simple archivo desde VB

Se usa Shell ( "<RutadelArchivo>")

Ejemplo:

Shell ("c:Micarpetaarchivo.xls")

y listo...
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