Let's say you have a school report or business document and you need to have some specific information appear on each page. How do you handle it? You add a Header and/or Footer to the document. Simple, right? In most cases it is. But what if you need information aligned differently, such as text along the left margin but also along the right? Or what if you need different information to appear on different pages?
You may be wondering how to handle these situations, particularly since it appears that you only get one header/footer feature per document. In this article, I show you the basics for setting up headers and footers in Word documents and I give you a few tricks to handle those more complex situations.
When you need to work with a Word document and it entails more than just basic typing, it is always a good idea to properly setup your page view so you have a few visual aids to help you see what's going on.
Click Tools|Options|View and check the option for Text Boundaries. This setting lets you better see your document margins. You'll also want to be in Print Layout view. Click View|Print Layout. (This view may also be called Page Layout view, depending on your version of Word).
To add a Header and/or a Footer to a Word document, choose View|Header and Footer. Then type in the necessary information and align the text, as shown in the image below.
If you need to insert information into the footer area, you can click in the footer area and start typing. However, whenever you are within the header/footer area of a document, the Header/Footer toolbar appears. Several shortcut icons on this toolbar help you navigate the header/footer area. You can click a toolbar button that switches your input point between the header and the footer.
You can type any text into the footer, but in many cases, you may want to insert page numbers. Note that the Header/Footer toolbar has buttons that display number signs (#), which are used for page numbering. If you want to insert numbering that shows this page number, as well as the total number of pages in the entire document, you can use both the Page Number icon and the Number of Pages icon, as shown below.
Once you finish entering your content, you can click the Close icon on the toolbar or just double click in the document area and the header/footer closes.
When you are not in the header/footer area, it is displayed in a gray font.
However, the text is not really gray. This is just Word's way of reminding you
that this information is contained in an area outside of the document content
itself. To see how the page would appear if printed, choose View|Print Preview.
Header/Footer Alignment Options
Users frequently need to insert some content as left aligned, but also insert right aligned text on the same line. Because of the way Word relies on styles, how to handle this effect may not appear obvious to most users.
The most common way to handle this formatting is to insert a right align tab marker along the right margin. Then you can type in your left-aligned content, press the Tab key to move to the right margin and type in your right-aligned content. To insert a right align tab, you can either use the Tab dialog box (choose Format|Tabs), or use the small button located in the top/left corner of the Word window below the toolbars. By clicking this button, Word cycles through each type of tab. When you see the type you want, you can drag the tab marker out onto your ruler. (Choose View|Ruler if your ruler isn't visible.)
As you can see in the image below, I have a right tab marker at the far right of the ruler. I typed my name along the left and pressed the Tab key. When I toggle on formatting markers (Ctrl + Shift + 8), I see the tab marker (an arrow) that shows a tab has been inserted between my name and the document title.
A somewhat more stable way to handle left/right alignment is to insert a table into the header or footer and align each cell separately. This technique is particularly useful if you also need to add content into the center position.
To try this technique, open your header or footer area and click Insert|Table. Insert a single row table with the number of cells you need. Be sure to set the table border to None, and then enter information into each cell. Set the alignment of each cell as needed. To easily change alignment, you'll want to remember these keyboard shortcuts: Ctrl + L = Left, Ctrl + E = Center, Ctrl + R = Right.
As you can see in the figure below, when the page prints, no one can tell you have a table inserted because it has no borders. Yet, when you view the document itself, you can see the individual table cells because the gridlines are showing (if they aren't visible, choose Table|Show Gridlines).
If you prefer not to use a table or tabs, you have one other tricky option. You can insert non-breaking spaces between the words you want to stick together and regular spaces between the words you want to separate. Then set the line of text to full justification. The words that are held together with non-breaking spaces stay together and when full justification is applied, the regular spaces widen and stretch the line to fit the page width.
To force the justification, you do need to add a soft return (Shift+Enter). You can get around that added line spacing by selecting that line and making the font size very small. I know, this trick sounds very complicated, but it's not and can be done easily as you type.
To try the justification trick, follow these steps:
1. Open a blank document.
2. Type your name along the left margin. Be sure to press Ctrl + Shift + Spacebar between your first and last name. This adds a non-breaking space instead of just an ordinary space. If you press Ctrl + Shift + 8 to turn on text markers, you see the tiny non-breaking space marker that looks like a degree symbol between your first and last name.
3. Type a regular space.
4. Type your City, a non-breaking space, and then your state. Now press Ctrl+J to apply full justification.
5. Now press Shift + Enter at the end of your line of text. You see that your name appears along the left margin and your city/state appears along the right.
As I mentioned, you may want to shrink the font size on the second line of text. Press Ctrl + Shift + < (less than key) several times while your cursor is on the second line to cause this line to have a smaller font applied to it. In the image below, you can see my version of these steps. (Press Ctrl + Shift +8 to turn on your text markers to see if your version looks the same as mine.)
Creating Separate Header/Footer Content
Headers and footers often have two other common requirements. You may want to use different content in different parts of a document, or you may want to automatically insert chapter names. Granted, different chapter names are different content, but you can automate this process using Fields so it happens as you insert each new heading.
To add completely different content into a header or footer, you need to insert a Section Break into your document. Section breaks essentially say "And now for something completely different." Using Section Breaks, you can change margins, reset page numbering, or in this case, change the header/footer content, from that point in the document point forward.
To try this process, create a sample document and insert some information into
your header. Now insert some sample text, so you have a couple of pages in your
document. For filler text, you can type =rand(10,5) and press Enter to fill
your pages with sample content. This command yields 10 paragraphs that each
contain 5 sentences. Just change the numbers as needed to insert the type of
sample content you need. This is a somewhat hidden tool used by instructors
to create quick, sample content. Additionally, you can press Ctrl + 0 (zero)
before you hit Enter to have each paragraph properly spaced. Try it.
At the end of your text, choose Insert|Break|New Page. If you have your formatting markers still turned on (Ctrl + Shift + 8), you'll see that a Section Break now appears at that location.
In your new page, click View|Header and Footer to move into the header/footer
area. But here's the most important action: make sure you click the button on
the Header/Footer toolbar that says Link to Previous. You want to turn this
button off so this new header is not linked to the previous header/footer.
By unlinking the header, you can enter new content into the header for this
section, yet keep the information in the header in the previous section intact.
Once you click the Link to Previous button to unlink the headers, you can enter new information. Your new text is used in the header from this point forward. As you can see below, my previous header still has my name, but the new page now says Susan Daffron in the same location of the new header.
Finally, you can have your document change content in the header/footer for
you, automatically, as you insert new information into the document. For example,
in a book or report, you may want the name of the current chapter inserted into
the header. To take advantage of this Field automation, you need to make sure
you have a proper style applied to the chapter or heading text you'll be referencing
in the header. (See the article "Getting
Started with Styles" for more information on styles.)
Open a new document as a sample. Type some text to serve as your first header. Select that text and apply the Heading 1 style to it. Now enter some gibberish to fill in a few pages. (Use the =rand(10,5) command I described earlier.)
After you have a heading and some content, switch to Header/Footer view by choosing View|Headers and Footers. Position your cursor where you want your heading to appear in the header and click Insert|Field. Scroll down to StyleRef and select it. In the right side of the dialog box, select the Heading 1 style. Close out of the field dialog box and you will now see that the text that has been styled with the Heading 1 style is now duplicated within your header!
Now each time you type a new header and apply the same Heading 1 style to that text, the contents of your header for that page change to display the new content that is using the heading style. As you can see below, my first page header contains the information in the first heading. However, the second page contains the new heading that appears on that page.
This technique is a great way to automate your document to ensure that you never have to worry about whether your heading is correctly updated. Because whatever you type as the actual heading content in the document is automatically inserted into the heading as that information changes.
For more information on headers and footers, stay tuned for the October issue of TechTrax, where I'll have an advanced article on automating headers.