This seems to be coming yp a lot lately. I am writing a FAQ on this subject.
Essentially, there are ALWAY three headers in rach section.
wdHeaderFooterPrimary
wdHeaderFooterFirstPage
wdJeaderFooterEvenPage.
There is no OddPage.There are two sitiation, basically.
Scenario 1.
Page Setup = NO Different first page; NO different odd and even.
In which case wdHeaderFooter shows as the header through the section.
wdHeaderFooter, in this case, is the first geader entered; regardless of the page number it is set on. Even page, Odd page, it does not matter, it becomes Primary.
Scenario 2
Page Set = Different first page, Different odd and even.
wdHeaderFooterPrimary is the header entered from an odd page, first page is the first page, even page is from an even page.
NOTE is you revert back to NO difference, the header shown is what was the odd page - because there IS no odd page, what was Odd becomes Primary, and that is what will show.
It is always a good idea to explicitly set headers IMMEDIATELY upon making a section. Insert two blank pages and set first / odd /even. The selete the pages. The text is stored as properties of the THREE header objects that are ALWAYS in a section.
Explicitly tun off Same as previous. you can always tun it back on. This aagin sets explicitly headers for the section, which are stored in the Section objects.
Going back and putting in text, BEFORE geteting rid of Same as previous removes the same as previous, but pulls the previous back up to the (later) current header.
Again, it is best practives to create the possibly header immediately. Going backwards cause confusion and much hair pulling.
The logic is this.
the Primary header is:
a) with no diiferences between first, or odd/even pages, is set by the FIRST header entered, regardless of apparent page number (odd/even)
b) with differences, set is set from the header entered from an odd page.
Once set to ANYTHING, the only way to change the Primary is:
a) with no differences, set by any page header
b) with differences, set by changing from an odd page.
If there were differences, thus creating possible separate text for FirstPage, OddPage, EvenPage, and these are stored as HeaderFooter object properties in the Section object. If there were differences, then difference removed, the headers would show as what was the odd page. Programatically, if you do an:
ActiveDocument.Sections(2).Headers(2).Range.Text
thus returning the Range.Text of Index 2 of the headers collection, of Section 2, you would get:
wdHeaderFooterFirstPage
Even though the page setup was set up to NO difference, and the header SHOWN is wdHeaderFooterPrimary, or what was Odd page, programatically, what is returned is still wdHeaderFootFirstPage if it contains a value > "".
This can not be emphasized enough. There is NO odd page header, there is Primary.
You should always, when making a new section, insert two new page breaks (Ctrl_Enter NOT section break next page!). Set the headers, and delete the pages. Any new real estate added to that section (with Same as previous turned off) will automatically fill in with the proper header. Any expansion that cause new pages within the section ( by typing text or insert text) will pick up the proper header stored in the Section.
To reply to your statement:
Page Setup, which does mention rules for headers and footers and whether they should apply to the whole document or just this section. But it doesn't seem to apply to matters of text and layout, which is what I'd like to control.
They do not directly apply to matter of text and layout. They do not create values in the three header objects, they USE them.
If you have something specific you wish assistance on, post here.
Please be specific. Application abd Version. What exactly problems have occured?
Gerry