【发布时间】:2013-02-26 15:42:18
【问题描述】:
我写了一个 vba 代码,浏览所有路径文件夹并搜索“strings.xml”文件。
Dim oFS As Office.FileSearch
Dim i As Integer
Set oFS = Application.FileSearch
With oFS
.NewSearch
.FileType = msoFileTypeAllFiles
.Filename = "strings.xml"
.LookIn = "D:\Workspace"
.SearchSubFolders = True
.Execute
MsgBox "Finish ! " & .FoundFiles.Count & " item found !"
End With
但是,在我的工作区中,我有许多当前代码所在的“strings.xml”文件,但我只想在特定子文件夹中找到“strings.xml”;例如./values/strings.xml 文件。
【问题讨论】:
-
你知道从 Office 2007 开始,Office.FileSearch 将不可用吗?