Written by Allen Wyatt (last updated March 1, 2022)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365
Mark uses a series of SEQ fields to number items on a page. In the header for the page, he would like to show the range of numbered items that appear on the page, such as 1234-1249. The SEQ fields work flawlessly, but Mark needs the header to update automatically to reflect the actual numbered sequence (first through last) on that page.
This is actually rather easy to do using the fields provided in Word. Fields allow you to create dynamic content, and in Mark's situation they can really shine. Before using the fields, however, there is a bit of "prep work" that needs to be done.
First, you'll need to make sure that the SEQ fields in your document are formatted with a style. Since the SEQ fields are (more than likely) not the only thing within the paragraph in which they are located, you should format them using a character style, not a paragraph style.
For instance, let's say that you create a style called MyNums that you intend to use for your SEQ fields. Apply it to all of them (just the SEQ fields, not anything else), and you will be ready to set up your headers.
Now, within your headers you are going to use the STYLEREF field to reference the first and last SEQ on each page. By default, the STYLEREF field displays the first content on a page that is formatted with a particular style. So, for instance, if you used this field you would get the first SEQ on the page that is formatted with the MyNums style:
{ STYLEREF "MyNums" }
Normally, people think of using the STYLEREF field to reference headings within a document, such as to create a running header that shows the first paragraph formatted with the Heading 1 style or the Heading 2 style on the page. This works fine, but you can also use STYLEREF to reference character styles, such as to reference the MyNums style.
If you want to reference the last occurrence of content formatted with the MyNums style, you would, instead, use the following field:
{ STYLEREF "MyNums" \l }
That's a lowercase "L" at the end of the field. This particular switch instructs Word to start its search for the MyNums style from the end of the page, going upwards. That way you get the last item formatted using MyNums.
So, to do what Mark wants done, you would use the following within the header for the document:
{ STYLEREF "MyNums" }-{ STYLEREF "MyNums" \l }
Remember that the {braces} are not actually typed into the heading; they are field braces and are inserted by pressing Ctrl+F9. Once the fields are inserted in the header, you can select them all and press Shift+F9 to collapse the fields and show the range of SEQ fields on the page.
You may notice that once you have the header set up, it may not appear to automatically update as you add new items to your pages. This is normal; the field codes are usually only updated when you go to print your document. Rest assured that they will reflect the correct range of items on the page when you actually do print.
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (11218) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365.
The First and Last Word on Word! Bestselling For Dummies author Dan Gookin puts his usual fun and friendly candor back to work to show you how to navigate Word 2013. Spend more time working and less time trying to figure it all out! Check out Word 2013 For Dummies today!
Word allows you to insert simple formulas, using fields, in table cells. You can also create simple conditional ...
Discover MoreA field can be locked or unlocked, and its condition controls whether it is updated automatically or not. If you want to ...
Discover MoreOne of the pieces of information tracked by Word is when a document was first created. Here's how you can access that ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
2018-03-26 08:23:54
Jennifer Thomas
Hugh, depending on the complexity of the Invoice code, you might be able to do that with page numbers; just type the letters (SC) before the field in the actual document and then use Format Number to make the page numbering start at the first numbering value (63969).
This would work especially well if it's a one-page invoice; otherwise you'd have to get a bit clever with your section breaks and header linking to get it to increment on the correct page (comment back with more details about the document structure if you need advice on that).
SEQ or LISTNUM fields would be the next solution to try, as those are more customizable, but I hope the above works for you.
2018-03-24 06:46:31
Hugh Gundersen
How about a field that automatically adds 1 to a number on the previous page, bit like a page number but like "Invoice Nr: SC63969" next page would be "Invoice Nr: SC63970" etc?
Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.
Visit the WordTips channel on YouTube
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments