Headings vs headers: how to use both in Word

Following my column about using table of contents (ToC) in Microsoft Word (see issue 231), reader James emailed me to ask for help with a related piece of Word functionality:

Headings vs headers: how to use both in Word

“I was reading your ToC piece in this month’s PC Pro with interest, since I was recently trying to use this tool myself. I gave up and manually typed it into the document. The reason being that my section headings were in the headers and footers section of Word, and I couldn’t get it to recognise them as “headings” for the table of contents. Please can you tell me whether this is a quirk in Word? The reason for putting the heading in the header section was to repeat it across a number of pages and break the document up with section breaks.”

Well, James I can assure you that you’re not being an idiot, it’s just that you’re thinking like a human being instead of a computer!

Word can do exactly what you want, but it isn’t at all obvious how you’re supposed to achieve it. That’s because it has to be done not by putting your headings into the header itself, but by putting a reference to your headings’ style into the header.

You must put your headings in the main body of the document as per normal, formatting them in “Heading 1” style (or whatever other style you deem appropriate). Then insert a StyleRef field into the header specifying “Heading 1” as the style to follow. The header will then repeat the appropriate heading on every page.

Click Insert | Text | Quick Parts | Field, select Links And References from the Categories dropdown, select StyleRef from the field name list and then select Heading 1 from the style names list. You shouldn’t need to click any of the options on the right-hand side of this dialog, except for “Preserve formatting during updates”, which should already be selected. Click OK to insert the field.

If you expand the field codes by pressing Alt+F9, what you see should look like this:


The StyleRef field in the header will pick up the first paragraph in the selected style and repeat it in every page header until it encounters another paragraph using that same style.

One of the biggest advantages of using a StyleRef field in this way is that you won’t have to change your headers, by adding section breaks, just to change what the header says – that’s a kludge you can do without.

Section breaks should be necessary only where you need to substantially change the page layout – for instance, the number of columns of text, the orientation (portrait or landscape) or the width of the margins.

Changing the text in headers or footers is something that you should achieve using content controls or fields.

Disclaimer: Some pages on this site may include an affiliate link. This does not effect our editorial in any way.

Todays Highlights
How to See Google Search History
how to download photos from google photos