Results 1 to 2 of 2

Thread: searching for text in a Word doc

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    Question 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

  2. #2

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    Thumbs down

    why is my code not formatted in VB colors?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width