The Dir way :

VB Code:
  1. 'Just add a listbox (List1)
  2.  
  3. Private Sub ListFiles(strPath As String, Optional Extention As String)
  4. 'Leave Extention blank for all files
  5.     Dim File As String
  6.    
  7.     If Right$(strPath, 1) <> "\" Then strPath = strPath & "\"
  8.    
  9.     If Trim$(Extention) = "" Then
  10.         Extention = "*.*"
  11.     ElseIf Left$(Extention, 2) <> "*." Then
  12.         Extention = "*." & Extention
  13.     End If
  14.    
  15.     File = Dir$(strPath & Extention)
  16.     Do While Len(File)
  17.         List1.AddItem File
  18.         File = Dir$
  19.     Loop
  20. End Sub
  21.  
  22. Private Sub Form_Load()
  23. ListFiles "C:\", "txt"
  24. End Sub