LOOK:
http://www.r4cn.com/resource/index.htm -->>
cSearchFile.cls 搜索文件的类。

解决方案 »

  1.   

    dim buf as string 
    buf=dir("i:\*.*")
    do whilr buf<>""
      if buf<>"." and buf<>".." then
       debug.print buf
      end if
      buf=dir
    loop
      

  2.   

    Private Sub Command1_Click()
        Dim i As String
        i = Dir(App.Path & "\*.*", vbReadOnly)
        Do While i <> ""
            MsgBox i
            i = Dir
        Loop
    End Sub
      

  3.   

    '调用Project-->References-->Microsoft Scripting Runtime
      Dim fso As New FileSystemObject
      Dim fi, fc,  f
      Set f = fso.GetFolder(你的文件名)
          '得到临时文件夹全部文件  Set fc = f.Files  '文件夹不存在,退出
      If Not fso.FolderExists(你的文件名) Then Exit Sub  For Each f1 In fc '编历
         debug.print f1.name 
      Next