Current Header and Footer Text

  • Thread starter Jeffrey Bradshaw
  • Start date
J

Jeffrey Bradshaw

Is there a way to find out what the text is in the header and footer for the
page you are currently on?

TIA - Jeffrey.
 
J

Jonathan West

Hi Jeffrey

The code above returns the text of the three possible headers for the
current section. If you don't have separate odd-even headers, and don't have
a separate first page header, then you only use the first one.

strHeaderMain =
Selection.Sections(1).Headers(wdHeaderFooterPrimary).Range.Text
strHeaderEven =
Selection.Sections(1).Headers(wdHeaderFooterEvenPages).Range.Text
strHeaderFirst =
Selection.Sections(1).Headers(wdHeaderFooterFirstPage).Range.Text
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top