title: Searching for Text in Header Section of A Word Document
body: <p>I am trying to confirm if a document contains some text, the only problem is this text is in the Header. This is the code I am using which constantly returns false even though the text exists:</p>
  
  <pre><code>Set CurrentDoc = Documents.Open("a.doc")
  
  With CurrentDoc.Sections(1).Headers(wdHeaderFooterFirstPage).Range.Find
      .Text = "This is the text to find"
      .Forward = True
      .Execute
      If (.Found = True) Then Debug.Print "Match"
  End With
  </code></pre>
  
  <p>The following also doesn't seem to work (I assume <code>.Content</code> doesn't include header/footers):</p>
  
  <pre><code>With CurrentDoc.Content.Find
      .Text = "This is the text to find"
      .Forward = True
      .Execute
      If (.Found = True) Then Debug.Print "Match"
  End With
  </code></pre>
  
  <p>Any help would be greatly appreciated.</p>