RESPUESTA A LA PREGUNTA 6132 - VISUAL BASIC Option Explicit 'Para ver los ficheros *.txt en A:\ mediante API: Private Const MAX_PATH = 260 Private Const INVALID_HANDLE_VALUE = -1 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 Private Declare Function FindFirstFile Lib "kernel32" Alias "FindFirstFileA" (ByVal lpFileName As String, lpFindFileData As WIN32_FIND_DATA) As Long Private Declare Function FindNextFile Lib "kernel32" Alias "FindNextFileA" (ByVal hFindFile As Long, lpFindFileData As WIN32_FIND_DATA) As Long Private Declare Function FindClose Lib "kernel32" (ByVal hFindFile As Long) As Long Private Sub MostrarDir(sPath) Dim hFind As Long Dim FindData As WIN32_FIND_DATA hFind = FindFirstFile(sPath, FindData) If hFind <> INVALID_HANDLE_VALUE Then Do Debug.Print Left(FindData.cFileName,InStr(FindData.cFileName,Chr(0))) Loop While FindNextFile(hFind, FindData) End If FindClose hFind End Sub ... También tienes la función Dir de VB: Private Sub MostrarDir(sPath) 'MostrarDir "a:\*.txt" Dim sName As String sName = Dir(sPath) While Len(sName) <> 0 Debug.Print sName sName = Dir Wend End Sub Pilar MMA martin_pil@gva.es