Disable Header when some style is present in the current page

J

jose_piratilla

At the start of new chapters or in some special pages I want to disable the
header. I have different headers for odd and even pages. They are composed of
a text including the page number, the chapter number and the chapter name,
and has a lower border to show a line below it.
I can delete the line from all headers so the problem can be reduced to a IF
field. But I don't know how to ask if in the current field there is present
some style.
I think in using the STYLEREF field to get the current value and store it on
a variable. If this variable changes then it means that the page contains
this style. But it doesn't work well.
 
S

Suzanne S. Barnhill

The only really practical way to do this, I think, is to insert section
breaks between chapters and enable "Different first page." You can then
leave the First Page Header blank.
 
J

jose_piratilla

Hi Suzanne,

Yes I knew this possibility but it is a lot of manual work. I want a way to
automatize it. I was thinking in a VBA function that reviews a page looking
for some styles. So I could use: { IF IsStylePresent({ PAGE })=1 " " "Bla bla
bla" }

I'm experienced using VBA with access but I don't know anything about the
word document object. Some help?

Thanks.
 
S

Stefan Blom

Ask in a programming newsgroup such as microsoft.public.word.vba.general; if
there is a way to do this with a macro, I'm sure someone there can figure it
out.
 

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