FileSearch Property Example

This example displays, in a series of message boxes, the file names in the My Documents folder that begin with 99.

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