Use of Styleref field

  • Thread starter Ã…ke Schantz
  • Start date
Ã

Ã…ke Schantz

Hello,

Can anyone help me out on the following problem.

I have a template where the first two pages are A4-portrait and the rest are
A4-landscape layout. There is a section break between these two main layouts
so that the landscape sections always begin on a left hand page.

In the first page of the portrait section I use "Heading 1" to format the
document title. This is the only place in the document where I use "Heading
1".

In the side heads of the landscape section, I have put in a STYLEREF
"Heading 1", without any switches.

When I view the document this field does not show any content. That is, the
"Heading 1" title from page 1 is not found and displayed. Why is this? Is
there some kind of block between sections that makes it impossible for the
field function to find the style in section 1?

Also in the side heads, I have put in Stylerefs to Heading 2 and 3. However,
since I am not always using Heading 3 in the document, sometimes the STYLEREF
"Heading 3" field displays the text:

"Error! No text of specified style in document."

I do not want this text to show up in a printed document. How can I hide
this message?

Furthermore, each new Heading 2 generates a new page break. I want this
break to to be set to a new left handed page. How do I achieve this. I'm
using a macro to insert the new Heading 2 paragraph. Is it possible to add a
section break to this macro?

Finally, if I have used a Heading 3 in one section and the following section
does not include a heading 3, I do not wish for the previous Heading 3 to be
displayed in the side head of the new section. How do I avoid this happening?

In conclusion:
Heading 2 and 3 should only be displayed in the side heads of the section to
which they belong. Heading 1 should be displayed in all side heads of the
document. eading 3 should only be displayed if it is used in a section and no
error message should be displayed for missing Headings.
 
S

Stefan Blom

Åke Schantz said:
Hello,

Can anyone help me out on the following problem.

I have a template where the first two pages are A4-portrait and the rest
are
A4-landscape layout. There is a section break between these two main
layouts
so that the landscape sections always begin on a left hand page.

In the first page of the portrait section I use "Heading 1" to format the
document title. This is the only place in the document where I use
"Heading
1".

In the side heads of the landscape section, I have put in a STYLEREF
"Heading 1", without any switches.

When I view the document this field does not show any content. That is,
the
"Heading 1" title from page 1 is not found and displayed. Why is this? Is
there some kind of block between sections that makes it impossible for the
field function to find the style in section 1?

If you are using blank paragraphs to create spacing in your text, that could
explain why some STYLEREF fields display blank; the fields simply pick up a
blank paragraph which happens to have the Heading 1 style applied. The cure
is to avoid blank paragraphs (or at the very least to apply a non-heading
style to such a paragraph).
Also in the side heads, I have put in Stylerefs to Heading 2 and 3.
However,
since I am not always using Heading 3 in the document, sometimes the
STYLEREF
"Heading 3" field displays the text:

"Error! No text of specified style in document."

I do not want this text to show up in a printed document. How can I hide
this message?

You can use an IF field to look for the error message and then suppress it:

{ SET test { STYLEREF 3 } }

{ IF { REF test } = "Error!*" "" "{ STYLEREF 3 }" }

Press Ctrl+F9 to insert each pair of field delimiters, { }. Press F9 to
update. To show/hide field codes, use Alt+F9.
Furthermore, each new Heading 2 generates a new page break. I want this
break to to be set to a new left handed page. How do I achieve this. I'm
using a macro to insert the new Heading 2 paragraph. Is it possible to add
a
section break to this macro?

You will have to insert an odd page section before each Heading 2.
Finally, if I have used a Heading 3 in one section and the following
section
does not include a heading 3, I do not wish for the previous Heading 3 to
be
displayed in the side head of the new section. How do I avoid this
happening?

To a certain extent you can control this by applying a character style to
text (in a strategic manner) and use that character style with a STYLEREF
field. There is no built-in way to make Word pick the "correct" subheading,
unfortunately.
 

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