
Tips.Net > WordTips Home > Formatting > Headers and Footers > Paragraph Numbers in Headers or Footers
Summary: The STYLEREF field is normally used to reference the text of the first or last paragraph on a page that is styled in a particular manner. You can also use the field to reference just the number of the paragraph, if it is numbered. This tip also presents a way to reference the numbers of manually numbered paragraphs. (This tip works with Microsoft Word 97, Word 2000, Word 2002, and Word 2003.)
Let's say that you have a rather long document--perhaps several hundred pages--and it consists of many numbered paragraphs. In your header or footer you would like to place the paragraph number of the first paragraph on the page.
Word provides a rather easy way you can do this using the STYLEREF field. The way you implement the solution, however, depends on how you have your paragraphs numbered. If you are using Word's numbering capabilities (from Format | Bullets and Numbering), then you should follow these steps if you wanted to place the paragraph number in the header:
{ STYLEREF Body Text \n }
These steps work because of the \n switch, which limits STYLEREF so that it displays only the paragraph number.
If you use a different numbering scheme for your paragraphs--such as manual numbers or perhaps SEQ fields--then the above approach will not work. Instead, you need to create a character style for your paragraph numbers and then apply it to all the numbers in the document. Then you can follow the above steps, but leave out the \n switch. You'll also change the style name in the field code so that it matches whatever character style you've used. For instance, if your style is NumStyle, you would use the following field code:
{ STYLEREF NumStyle }
Provided that NumStyle is a character style, applied only to your paragraph numbers, then when you collapse the STYLEREF field, it shows only the characters you've formatted with the style (your paragraph numbers).
It is interesting that the Word documentation indicates that the STYLEREF field works only with paragraph styles, giving the impression that it won't work with character styles. Testing has shown that this is misleading; STYLEREF will work just fine with character styles as described here.
Tip #230 applies to Microsoft Word versions: 97 2000 2002 2003
Step Up and Take Control! Subscribers to WordTips know just how valuable a resource it is. WordTips Premium provides twice the number of exceptional, easy-to-understand tips every week in an ad-free newsletter, as well as substantial discounts on WordTips archives and e-books.
Check out WordTips Premium today!
Uncover how you can master the full potential of printing your documents. Everything you wanted to know about printing and printers, using Word. (more information...)
Ask a Word Question
Make a Comment
Beauty Tips
Bugs and Pests Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Organizing Tips
Pet Tips
Word2007 Tips
WordTips