Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub FindText()
- Dim i As Integer
- 'Search criteria
- With Application.FileSearch
- .LookIn = "c:\my documents\logs" 'path to look in
- .FileType = msoFileTypeAllFiles
- .SearchSubFolders = False
- .TextOrProperty = "*Find*" 'Word to find in this line
- .Execute 'start search
- 'This loop will bring up a message box with the name of
- 'each file that meets the search criteria
- For i = 1 To .FoundFiles.Count
- MsgBox .FoundFiles(i)
- Next i
- End With
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement