FileSearch Property Example

This example displays the names of all files in the My Documents folder that begin with "New."

With Application.FileSearch
    .FileName = "New*.*"
    .LookIn = "C:\My Documents"
    .Execute
    For I = 1 To .FoundFiles.Count
        MsgBox .FoundFiles(I)
    Next
End With