- Код: Выделить всё
Sub MyMacros()
Dim sPth As String
Dim sKey As String
Dim nFound As Integer
sPth = "d:\docs"
With Word.Application.FileSearch
.NewSearch
.LookIn = sPth
.SearchSubFolders = True
.TextOrProperty = "справка"
If .Execute() > 0 Then
For i = 1 To .FoundFiles.Count
sKey = .FoundFiles(i)
nFound = nFound + 1
Next i
End If
End With
MsgBox ("Найдено " + CStr(nFound) + " файлов")
End Sub