FileSearch 属性

       

返回一个 FileSearch 对象,该对象可用于使用绝对或相对路径搜索文件。

expression.FileSearch

expression   必需。该表达式返回一个 Application 对象。

示例

本示例在一系列消息框中显示 My Documents 文件夹中所有以 99 开头的文件名。

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