how can i insert chapter title automatically into header

R

Rekha

I would like to add chapter heading into header section and it should update
automatically whenever I change the title - i need scripting details.
 
J

Jay Freedman

Look in the help topic about the StyleRef field. You don't need any
scripting.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
S

Stefan Blom

Are you using a particular style for your chapter headings? If so, you
can use a STYLEREF field to display the "current" text in that style
in your headers.

Here's how to do it: On the View menu, click Header and Footer. With
the cursor in the header area, press Ctrl+F9. Word inserts field
delimiters, {}. Within these, type STYLEREF "stylename_here". For
example, if you are using Heading 1 as the style for chapter text, you
would type STYLEREF "Heading 1". (Actually, since the built-in
headings have "magical" properties, you can use STYLEREF 1 instead.)
Press F9 to update the display. If your headings are outline-numbered,
and you want to display the number too, you'd have to insert another
STYLEREF field like this: { STYLEREF "stylename" \n }.

--
Stefan Blom
Microsoft Word MVP


in message
I would like to add chapter heading into header section and it should update
automatically whenever I change the title - i need scripting
details.
 
K

kwschnautz

Awesome! Thank you, Stefan for the SYTLEREF solution. Using {STYLEREF 1} Worked perfectly!
 
S

Stefan Blom

You are welcome.

Note that there was a bug with STYLEREF in the initial version of Word 2013,
but it should be fixed if you have installed Service Pack 1.
 

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