Changing header references

B

britbrez

In my template, I have headers that reference the Heading 1 and Heading2
styles on each page. When I have a Heading1 paragraph and no Heading2 on a
page, the field code picks up the Heading1 style for that page and the
Heading2 style from the previous page. Is there a way to keep the Heading1
and Heading2 StyRef field codes in the headers but include some kind of
coding that tells the reference not to include the Heading2 style reference
if there is not a Heading2 paragraph in that section/page?
Example:
(page1 header includes) Heading1 title:1 - Heading2 title:1-A)
Heading1 title:1
text
Heading2 title:1-A
text
(next page header includes) Heading1 title:2 - Heading2 title:1-A (I want
this title to be blank)
Heading1 title
text (end of page)
Thanks!
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?YnJpdGJyZXo=?=,

No, there's not. If you look at the available switches for this field (go to
the Word Help and search on StyleRef field) you'll see that the best you can
do is to change the search direction. But there's no way to limit the range
that's searched, nor to tell the field to not pick up anything.

You'd need to handle the header/footer content programmatically (using a
written macro).
In my template, I have headers that reference the Heading 1 and Heading2
styles on each page. When I have a Heading1 paragraph and no Heading2 on a
page, the field code picks up the Heading1 style for that page and the
Heading2 style from the previous page. Is there a way to keep the Heading1
and Heading2 StyRef field codes in the headers but include some kind of
coding that tells the reference not to include the Heading2 style reference
if there is not a Heading2 paragraph in that section/page?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

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