To insert a header you can go to the top of a page in Word and make a double-click or go to section “Insert” and click on the button “Header”. To display the heading and the chapter number automatically in the header the prerequisite is that the headings are defined as heading levels as it is described in the previous chapter.
The formula is visible in the following screenshot:
To insert the formula I recommend following approach:
Copy the following text into your header:
If STYLEREF "Heading 1" n<"1""" STYLEREF "Heading 1" n STYLEREF "Heading 1"
Afterwards the curly brackets have to be inserted. They are not inserted as a normal text but with the control key short cut Ctrl+F9. The text that has to be set into brackets has to be highlighted and afterwards press Ctrl+F9. For the above formula this has to be done 4 times:
The first text part STYLEREF “Heading 1” n has to be highlighted and set into brackets with Ctrl+F9. The same applies to the 2nd part, STYLEREF “Heading 1” n and the entire first part of the formula If STYLEREF “Heading 1” n <“1″””STYLEREF “Heading 1” n . Finally the last part of the formula has to be set into brackets STYLEREF “Heading 1”
To see the chapter headline and the chapter number the field codes have to be deactivated. Therefore highlight the entire formula, make a right-click and choose “Toggle field codes”. Therewith each chapter will be displayed in the header of the word document.
Here is a further tip: The horizontal line below the formula that is visible in the screenshot can be inserted by clicking Home/Bottom border/Horizontal line. With double-clicking on the horizontal line you can edit the color and thickness.
The next chapter describes how to get a different page numbering in the footer: