title: Extract Page 1 Header from Word Doc
body: <p>I'm trying to extract multiple lines of text from the page 1 Header of an MS Word Document (.docx). I'm using python.docx but can't determine how specific I need to get in order to get only the 1st page header.</p>
  <p>Code is currently:</p>
  <pre><code>from docx import Document
  document = Document(&quot;path.docx&quot;)
  section = document.sections[0]
  header = section.header
  print(header.paragraphs[0].text)
  </code></pre>
  <p>With the output: &quot;Name of File; Smith; Page&quot;</p>
  <p>Screenshots linked for the content I'm referring to with Headers versus Running Header. I want the Header, I don't care about the Running Header:
  <a href="https://i.stack.imgur.com/H9EQH.png" rel="nofollow noreferrer">Header 1</a>
  <a href="https://i.stack.imgur.com/gYOuq.png" rel="nofollow noreferrer">Running Header</a></p>
  <p>Any help appreciated! I've looked at the documentation for headers in general (<a href="https://python-docx.readthedocs.io/en/latest/user/hdrftr.html" rel="nofollow noreferrer">https://python-docx.readthedocs.io/en/latest/user/hdrftr.html</a>) but it does not go into specifics for dealing with the Different First Page Header feature of MS Word.</p>