Field codes for headers

G

Guest

Let's say I have a long document with 10 different sections. I have
automatically numbered headings for each section; for example, "Section 1.
Executive Summary," "Section 2. Risk Factors," and so on.

How can I use field codes in the headers so that when new sections are
inserted between existing ones, the headers will automatically change to the
correct section number AND the accompanying text?

Am I dreaming?
 
N

Nozza

Let's say I have a long document with 10 different sections. I have
automatically numbered headings for each section; for example, "Section 1.
Executive Summary," "Section 2. Risk Factors," and so on.

How can I use field codes in the headers so that when new sections are
inserted between existing ones, the headers will automatically change to the
correct section number AND the accompanying text?

Use insert/field/Styleref and then choose which style - say Heading 1.

HTH

Noz
 
G

Guest

You need to use the StyleRef field referencing the Heading Level (presumably
Level 1 for the section heads) inserted into the Headers. StyleRef will (by
default) pick up the nearest referenced style automatically. So each section
will automatically pick up the section heading.

One of the advantages of using the StyleRef for Headers (or Footers) is that
you can eliminate the need to create new Word sections. Simply starting a
new main level 1 heading on a new page (use PageBreakBefore as part of the
Heading 1 style) and the runing StyleRef will pick up the new headings.
 
G

Guest

Hi, Terry:

Thanks so much for your wonderful help as usual. I had no idea that I
didn't need section breaks.

I don't want to wear out my welcome, Terry, but just one more thing: Is
there any way that I can include the words following the heading. For
Example in "Section 1. Executive Summary" could the "Executive Summary"
somehow be included?

If not, with your instructions, I'm still way ahead of the game.

Thanks again!
 
G

Guest

You'd need to make both 'Section 1' and 'Executive Summary' the Heading 1
Style and in the same Paragraph. Even if the words 'Executive Summary' are
on the next line, use a Line Break rather than a paragraph break to move it
to the next line. Then the StyleRef will pick up the whole of the Heading.

Terry
 
S

Suzanne S. Barnhill

Note, however, that if a heading includes a line break, this will be picked
up by the StyleRef field. For some workarounds, see
http://sbarnhill.mvps.org/WordFAQs/StyleRef.htm

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

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
G

Guest

Terry, thanks again for this and all you do.

You'd need to make both 'Section 1' and 'Executive Summary' the Heading 1
Style and in the same Paragraph. Even if the words 'Executive Summary' are
on the next line, use a Line Break rather than a paragraph break to move it
to the next line. Then the StyleRef will pick up the whole of the Heading.

Terry
 
S

Suzanne S. Barnhill

Note that another approach, if you have text on two lines (in two separate
paragraphs, with two different styles) is just to use two StyleRef fields,
one for each style. In your case, however, if "Section 1" is autonumbering,
you will have to have two StyleRef fields, anyway, one to pick up the
heading number and one to pick up the heading text.

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

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top