title: .Find not working in Word from Excel vba
body: <p>I'm trying to get information from a table in Word and pull it into Excel, since the number of tables is variable and I have no other way to reference the table I wanted to find the table directly after the text before it in the document. I've used the .Find method before but for some reason I can't get it to work this time and from everything I've read and used before, this should work:</p>
  
  <pre><code>Sub Process_NIM()
      Dim WordPullFile As Object
      Dim PullFolder As String
      Dim PullDate As Date
      Dim AppWord As Word.Application
      Dim wd As Word.Document
      Dim Table1 As Word.Table
      Dim wb As Workbook
      Dim ws1, ws2 As Worksheet
      Dim Text1 As Word.Range
  
      PullDate = DateAdd("d", 1, Now())
      PullFolder = "M:\Production Case Files\" &amp; Format(PullDate, "YYYY") &amp; _
          " Production Case Files\" &amp; UCase(Format(PullDate, "MMM")) &amp; _
          "\" &amp; UCase(Format(PullDate, "MMM DD")) &amp; "\"
      On Error GoTo OpenFileError
      Set WordPullFile = Application.FileDialog(msoFileDialogOpen)
      With WordPullFile
          .AllowMultiSelect = False
          .Filters.clear
          .Filters.Add "DOC Files (*.doc)", "*.doc"
          .InitialFileName = PullFolder
          .Show
      End With
      On Error GoTo 0
      If WordPullFile.SelectedItems.Count &gt; 0 Then
          PullFolder = WordPullFile.SelectedItems(1)
      End If
  
      Set AppWord = CreateObject("Word.Application")
      Set wd = AppWord.Documents.Open(PullFolder)
      wd.Application.Visible = True
  
      Set wb = ThisWorkbook
      Set ws1 = wb.Worksheets(1)
      Set ws2 = wb.Worksheets(2)
  
      If Text1.wd.Selection.Find.Execute(findtext:="Generator Outages for Today - Greater than 25MW") = True Then
          'do stuff
      End If
  
  OpenFileError:
      MsgBox ("There was an error opening the word file. Try closing any other instances of word and re-run.")
      Exit Sub
  
  End Sub
  </code></pre>
  
  <p>I use this from Word currently, but I can't get it to work from Excel:</p>
  
  <pre><code>If Text1.Find.Execute(findtext:="RC South Regional Review for") Then
      Text1.InsertAfter (" " &amp; Format(FileDate, "MMMM DD, YYYY"))
  End If
  </code></pre>