View Single Post
  #5   Report Post  
Posted to microsoft.public.word.pagelayout
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default How to change a header for each chapter of a book in word doc.

Find additional information at
http://sbarnhill.mvps.org/WordFAQs/StyleRef.htm.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

"Graham Mayor" wrote in message
...
The help file in Word 2007 is inadequate

2003 on the other hand defines it thus:

Field codes: StyleRef field
{ STYLEREF StyleIdentifier [Switches ] }
Inserts text that's formatted with the specified style (style: A
combination of formatting characteristics, such as font, font size, and
indentation, that you name and store as a set. When you apply a style, all
of the formatting instructions in that style are applied at one time.).
When inserted in a header or footer (header and footer: A header, which
can consist of text or graphics, appears at the top of every page in a
section. A footer appears at the bottom of every page. Headers and footers
often contain page numbers, chapter titles, dates, and author names.), the
STYLEREF field prints the first or last text formatted with the specified
style on the current page, allowing you to print dictionary-style headers
or footers.

Instructions
StyleIdentifier
Name of the style used to format the text you want to insert. The style
can be a paragraph style (paragraph style: A combination of character- and
paragraph-formatting characteristics that are named and stored as a set.
You can select a paragraph and use the style to apply all of the
formatting characteristics to the paragraph at one time.) or a character
style (character style: A combination of any of the character formatting
options identified by a style name.). If the style name contains spaces,
enclose it in quotation marks.
Switches
\l
Inserts the last text formatted with the style on the current page instead
of the first text formatted with this style. Microsoft Word searches the
page for the style from bottom to top instead of from top to bottom (the
default).
\n
Causes the field to display the entire paragraph number for a referenced
paragraph without trailing periods. No information about prior levels is
displayed unless it is included as part of the current level.
\p
Causes the field to display its position relative to the source bookmark
(bookmark: A location or selection of text in a file that you name for
reference purposes. Bookmarks identify a location within your file that
you can later refer or link to.) using the word "above" or "below."
If the STYLEREF field appears in the document before the bookmark, it
evaluates to "below."
If the STYLEREF field appears after the bookmark, it evaluates to "above."
If the STYLEREF field appears within the bookmark, an error is returned.
\r
Inserts the entire paragraph number of the bookmarked paragraph in
relative context- or relative to the paragraph numbering scheme- without
trailing periods.
\t
When used with the \n, \r, or \w switch, causes the STYLEREF field to
suppress nondelimiter, or nonnumerical, text.
With this switch, for example, you can reference "Section 1.01," and only
"1.01" is displayed in the result.
\w
Inserts the paragraph number of the bookmarked paragraph in full context,
from anywhere in the document.
For example, when referencing paragraph "ii.," a STYLEREF field with the
\w switch would return "1.a.ii" as a result.
Examples
If inserted in a header, the following field displays the contents of the
first paragraph formatted with the style "Heading 3" on the current page.
Field:
On this page: { STYLEREF "Heading 3" }
Result:
On this page: Summary of Sales by Region
To print the first and last names that appear on each page in the
membership directory for your organization, first apply a character style
(character style: A combination of any of the character formatting options
identified by a style name.) to each member's last name. Then insert
STYLEREF fields in the header. The second STYLEREF field includes the \l
switch, which inserts the last name on the page.
Field:
{ STYLEREF "Last Name" }- { STYLEREF "Last Name" \l }
Result:
Anders- Bendal
STYLEREF field location
Where you insert the STYLEREF field determines the direction that
Microsoft Word searches for the style and thus can affect which text is
inserted.
When you insert the field in:
Document text
Word searches backward from the STYLEREF field for the specified style. If
the style isn't found, Word searches forward from the STYLEREF field.
Footnotes, annotations, and endnotes
Word searches backward from the footnote, annotation, or endnote reference
mark for the specified style. If the style isn't found, Word searches
forward from the reference mark.
Headers and footers (results for printed document)
Word searches the current page, from top to bottom, for the specified
style. If the style isn't found, Word searches next from the top of the
page to the beginning of the document, and then from the bottom of the
page to the end of the document.
If the \l switch is used, Word searches from the bottom of the page to the
beginning and then to the end of the document.
Headers and footers (results for electronic document)
Word searches the section (section: A portion of a document in which you
set certain page formatting options. You create a new section when you
want to change such properties as line numbering, number of columns, or
headers and footers.) that contains the STYLEREF field, from the
beginning, for the specified style. If the style isn't found, Word
searches from the end of the section to the end of the document.


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



LoveOneAnother wrote:
A search on StyleRef in Word 2007 Help results in "No results were
found matching "StyleRef"


"Suzanne S. Barnhill" wrote:

You can accomplish this with a StyleRef field in the header (see the
Help for more information about this field), or you can insert
section breaks between chapters, unlink the headers, and put
different content in the header for each section.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

"Vanessa" wrote in message
news Im trying to put a different header on each page, but it won`t let
me change
one page to the other. Its like the first header i have is locked
on all the
pages.

Please Help
Vanessa