麻烦各位一下,解我解答一下.(可复选的)
希望速度上能跟上.

解决方案 »

  1.   

    '获取某目录下的所有子目录及文件的名称
    Public Sub SeachFile(ByVal strPath As String)
        Dim Fso As Object
        Dim Fol As Object
        Dim Fil As Object
        Set Fso = CreateObject("Scripting.FileSystemObject")
        Set Fol = Fso.GetFolder(strPath)
        
        For Each Fil In Fol.Files
            Debug.Print Fil.Path   '打印路径及文件名
            Debug.Print Fil.Name   '只打印文件名
        Next
        For Each Fol In Fol.subfolders
             Debug.Print Fol.Path  '打印子目录的名称
             Debug.Print Fol.Name  '只打印目录名
             SeachFile Fol
        Next
    End SubPrivate Sub Command1_Click()
        SeachFile ("C:\Test\")
    End Sub
      

  2.   

    同意Tiger_Zhao(VB老鸟)的意见,根据需要加载目录和文件或者可以考虑使用系统提供的对话框