by Peter Deegan
We've all seen the neat page footers that include the chapter or section heading automatically like this:
We assume that that Word can do it ... but how? It's a common question here at My Computer Company central control and frankly I don't blame anyone for confusion since the answer is not immediately obvious.
Of course you need to insert a field into the footer, just in the same way that {PAGE} inserts the page number, but you can search through the Insert / Field dialog box and no obvious candidates leap out at you.
What you're after is STYLEREF (it's under "Links and References") to do the job.
The basic format is {STYLEREF "StyleName" [Switches]} You insert the name of the style you want usually with quotation marks around it. So {STYLEREF "Heading 2"} in a footer will insert the text of the first Heading 2 style that Word finds.
By default, Word will search for the style starting at the top of the current page to the bottom, if nothing is found then it searches towards the start of the document. You can change this by using the \l switch to force the search to start at the bottom of the current page.
The \n switch makes Word insert any automatic numbering attached to the style (without any text before or after set in the style) instead of the text of that heading. If you want both the number and the text you need two STYLEREFs. To get any text before or after numbering you need to insert the text manually (nasty, but there seems to be no automatic method). For example, here is a heading in a style called "Numbered" then the results of various STYLEREF fields:

You can insert more than one STYLEREF for different styles to get a series of headings at the top or bottom of each page, so that these fields (centered)
{STYLEREF "Heading 1"} - {STYLEREF "Heading 2"} - {STYLEREF "Heading 3"}
might look like this in the final document footer:
Headers and Footers are the most common places for STYLEREF but there's nothing stopping you using STYLEREF in any place where you want an automatic reference to the chapter heading. It's just one of the many document automation options that will be covered in future issues.
Peter’s firm, My Computer Company, has been the Australia/Asia distributor of WOPR since the halcyon days of Word 1. He spends much of his time spreading the word about WOPR, PRIME, and other Word goodies. You can reach Peter at 100033.141@compuserve.com.
Turn to page 1 - Office 95 Review by Woody Leonhard, T. J. Lee, and Lee Hudspeth
Turn to page 5 - Tape Backup Strategies by M. David Stone
Turn to page 8 - Relocating My Documents by Michael Gordon
Turn to page 9 - Removing "Shortcut to" by Ronald Beekelaar
Turn to page 11 - Office Shortcut Bar by Michael Gordon
Turn to page 13 - Upgrading to Word 95 by Woody Leonhard / T. J. Lee
WUON is no longer available as a subscription newsletter.
Return to WUON Issue 1, Page 1
Copyright © 1996 Pinecliffe International.