Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

STYLEREF in Word 2000

Status
Not open for further replies.

lledod

Technical User
May 8, 2002
18
0
0
GB
Hi

I am using the field attribute STYLEREF in the header of a document to show the current Heading level. I made a style called "Heading1" and STYLEREF showed it correctly. So as not to confuse users of the template I have started using the Microsoft standard "Heading 1" but if I apply STYLEREF in the same manner I get an error message.

Does anybody know either why this could be happening or another way to put a Heading 1 text is the header bearing in mind that the heading text will change throughout the document and I do not want to resort to using sections as it is going to be used as a template.

I am more used to FrameMaker so I am finding this just a little frustrating.

TIR

Dave
 
If you have a space in the name of the style you need to surround the style name with double quotes as in

STYLEREF "Heading 1"

You can get away without the quotes if there is no space as in

STYLEREF Heading1
 
I am curious, could you explain:
I do not want to resort to using sections as it is going to be used as a template.

Gerry
 
Thanks cheerio, I will give it a go when I get back to it on Monday.

Fumei, It is an easy problem to solve if you use a new Heading 1 style for each new section but I am making a template for a group of people who would not want to do that if they even knew how to, so in addition to the template I would end up writing a user guide on how to use it which they would not read. Hence I needed a more of a users hands off approach so they just get on with the writing.

Dave
 
Sorry, but that makes no sense. The Heading 1 style is applied to paragraphs...not Sections. The Heading 1 style has nothing at all to do with Sections. Further, it nothing to do with the use of templates.

Could you try again to explain what you mean?

Gerry
 
I think I may understand what you are doing wrong - but your posting isn't too clear.

What you are requesting is for the Header to have the section heading? To do this, you do not need to start new sections: it is best to avoid new sections unless absolutely necessary.

All you need to do is to edit the built in Heading 1 Style to include the Paragraph, PageBreakBefore attribute. Then when a user needs to start a new 'Section or Chapter', they just type in the title and assign it the Heading 1 style. This will force Word to start a new page and the StyleRef field in Header will automatically pick up the new Heading 1.

Note that StyleRef by default picks up the nearest Heading 1 to the top of the current page - so if you happen to have 2 Headings 1s on a page, it will pick the top most Heading 1. this behaviour can be changed by adding switches to the StyleRef field.


Regards: tf1
 
Ok I am probably not explaining this very well as I am used to using FrameMaker and the terminology might be different or I am expecting miracles from a word processor.

I am doing a template for a company in Word and I want a header that has the textof the current Heading 1. The only way I could find to do this was using the field STYLEREF in the header. This picks up the first of the designated style and puts it in the running header. It worked for me when I used the styleref Heading1 but not when I used the styleref Heading 1.

I now know the answer, put Heading 1 in as "Heading 1" and I get a running header reading the current Heading 1 text.

I did not want to use sections as this would require more user input.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top