Mega Code Archive

 
Categories / VisualBasic Script / File Path
 

Find a file with wildcard character

Sub findFile() Dim i As Integer    With Application.fileSearch         .NewSearch         .LookIn = "c:\"         .FileName = "*.mdb"         .SearchSubFolders = True             If .Execute() > 0 Then                For i = 1 To .FoundFiles.Count                  Debug.Print .FoundFiles(i)                Next i             End If     End With End Sub