Hi LM,
Start with the "How to read the filenames of all the files in a directory
into an array" article at
http://word.mvps.org/FAQs/MacrosVBA/ReadFilesIntoArray.htm
At the beginning of your routine, create an array of the words that you want
to look for, as in the following:
Dim aKeywords
aKeywords = Array("Keyword1", "Keyword2")
From the routine in the article, you will want to modify this part so that
it 1) looks for your keywords in the filename of the document or 2) opens the
document and looks for your keywords
For Counter = 0 To UBound(DirectoryListArray)
'Debug.Print writes the results to the Immediate window (press Ctrl + G
to view it)'
Debug.Print DirectoryListArray(Counter)
Next Counter
Here's an example for number 1.
Dim lKeywords As Long
For Counter = 0 To UBound(DirectoryListArray)
For lKeywords = LBound(aKeywords) To UBound(aKeywords)
'''if the name of the file contains the keyword (all lowercase)
'''then print the name of the file in the immediate window
If InStr(1, LCase(DirectoryListArray(Counter)),
LCase(aKeywords(lKeywords))) <> 0 Then
Debug.Print
End If
Next lKeywords
Next Counter
HTH,
Dave