Need List of Files Containing Specific Text
I have to update all .dot files that contain 1 of 2 specific text strings within the body of the file. I estimate that about 1,500 out of 14,000+ files will need to be updated. Rather than manually go through all 14,000+ files trying to find the ones I need to edit, is it possible for a macro to search through a selected directory and search all files in folders and subfolders within that directory, then in a separate document use a table to return:
-- the filepath
-- the filename
-- the text string that was found
for any files that contain either of the 2 text strings?
Also, some files are locked, so they may need to be unlocked in order to do the search. The results could be in a Word document or an Excel spreadsheet.
Thanks for your help!
Cheryl
Love the code - can you help a VBA newbie with a question?
I know this was posted some time ago, but I've tested it and it's working great.
I'm using it to search through excel files in a SharePoint folder.
What I need to do is loop at the strSearch for several different text strings.
I'm not sure how to have it loop at this point. Can you help please?
Code:
'Change as desired
strPath = "c:\Users\My\Desktop" '//////////////// <--- Change directory here \\\\\\\\\\\\\\\\\\\\\\\\
strSearch = "To" '///////////////// <--- Change term to search for here \\\\\\\\\\\\\\\\\\\\\\\
Sincerely,
Mike