searching for text in a Word doc
I have several Word .doc files in a directory and I need to search
all of them to see if a certain string of text is found. I don't want
any of the documents to be opened, I just want the name(s) of
the documents that the text is found in to be returned to the
user and give the option to open the document(s).
All my code does so far is open a single document:
Code:
Option Explicit
Dim wordApp As Word.Application
Private Sub Form_Load()
Set wordApp = New Word.Application
wordApp.Documents.Open App.Path & "\test.doc"
wordApp.Visible = True ' optional
wordApp.Activate ' optional
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set wordApp = Nothing
End Sub