用通配符搜索指定文件夹中的文件

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

Sub SearchTheName(objFolder)
   If arrOptions(Folder_Name) = 1 Then
      For Each objSubFolder In objFolder.SubFolders
         strName = objSubFolder.Name
         If 0 <> FindInName(strName, strFindKeyWord) Then
            strFoundFile = strFoundFile & objSubFolder.Path & vbCrLf
         End If
      Next
   End If
   For Each objFile In objFolder.Files
      If 0 = InStrRev(strFindKeyWord, ".") Then
         strName = objFso.GetBaseName(objFile.Path)
      Else strName = objFile.Name
      End If
      If 0 <> FindInName(strName, strFindKeyWord) Then
         strFoundFile = strFoundFile & objFile.Path & vbCrLf
      End If
   Next
   If arrOptions(Sub_Folder) <> 1 Then Exit Sub
   For Each objSubfolder In objFolder.SubFolders
      SearchTheName objSubfolder
   Next
End Sub

Dim objShell,objFolder
Set objShell=Createobject("Shell.Application")
Set objFolder=objShell.BrowerFolder(0,"Choose Folder",0,0)
If Not objFolder Is Nothing then
    SearchTheName objFolder.Self.Path
End If
Set objFolder=Nothing
Set objShell=Nothing