{ STYLEREF "Heading 1,Chapter Level" } Not Working

G

GwenH

I have a document with multiple chapters. The first page of each chapter has
this:

1
Introduction

The number 1 has the style "Heading 1,Chapter Level" applied. The word
"Introduction" has the style "Heading 1,Chapter Level + Before: 0pt" applied.
When I attempt to use { STYLEREF "Heading 1,Chapter Level" } to insert the
chapter number in table numbers (i.e., "Table 1-2", where "1" is the chapter
number and "2" is the table number), it doesn't work. The table number
portion of it is working just fine, using { SEQ Table \* ARABIC \s 1 }. It's
just the chapter number that isn't working. Instead of a chapter number, I'm
getting the word "Introduction".

Any ideas how to fix this?

Thanks in advance,
Gwen H
 
J

Jean-Guy Marcil

GwenH said:
I have a document with multiple chapters. The first page of each chapter has
this:

1
Introduction

The number 1 has the style "Heading 1,Chapter Level" applied. The word
"Introduction" has the style "Heading 1,Chapter Level + Before: 0pt" applied.
When I attempt to use { STYLEREF "Heading 1,Chapter Level" } to insert the
chapter number in table numbers (i.e., "Table 1-2", where "1" is the chapter
number and "2" is the table number), it doesn't work. The table number
portion of it is working just fine, using { SEQ Table \* ARABIC \s 1 }. It's
just the chapter number that isn't working. Instead of a chapter number, I'm
getting the word "Introduction".

Any ideas how to fix this?

Are you using Automatic numbering on not? For this to work, you must either
use automatic numbering fro the heading 1 style and use a different syle for
the second line of the chapter title ("Heading 1,Chapter Level + Before: 0
pt" is not a style you created, but one Word created when you manually
modified the text on the page.)

Also, if you are using automatic numbering, the STYLEREF field needs the \n
switch to pick it up. So, if you were using Heading 1 and automatic numbering
(you can use a manual line break to separate the number and the text on a
second line, i.e Shift-Enter), you could use {STYLEREF 1 \n} to display the
previous Heading 1 number and {STYLEREF 1 } to display the previous Heading 1
text.
 
G

GwenH

Thanks! I figured it out and I've got it working. The only problem is, now I
need to replace the field codes of about 40 or 50 tables. For example,
instead of

{ STYLEREF 1 \s }

I need to replace it with { STYLEREF "EPRI Chapter Number" \n }

Is there a quick and easy way to do this?

Thanks again,
Gwen H
 
G

GwenH

Never mind, I answered my own question. I pressed Alt + F9 to toggle field
codes off. I selected the one correct field code and pressed CTRL + C. Then I
positioned my cursor immediately after the first incorrect field code. I
defined a macro that would select the field codes by pressing the shift key
and hitting the left arrow key 5 times. Then I had the macro do CTRL + V.

After that, all I had to do was find each incorrect field code, click
immediately after it, and run the macro. It might not be the most elegant
solution, but it got the job done in a fairly short amount of time.

Thanks anyway,

Gwen H
 
J

Jean-Guy Marcil

GwenH said:
Never mind, I answered my own question. I pressed Alt + F9 to toggle field
codes off. I selected the one correct field code and pressed CTRL + C. Then I
positioned my cursor immediately after the first incorrect field code. I
defined a macro that would select the field codes by pressing the shift key
and hitting the left arrow key 5 times. Then I had the macro do CTRL + V.

After that, all I had to do was find each incorrect field code, click
immediately after it, and run the macro. It might not be the most elegant
solution, but it got the job done in a fairly short amount of time.

After you hit ALT-F9, you could have used the Find/Replace dialog to do it
even faster...
 
G

GwenH

Nope, tried that, and it didn't work.

Gwen H

Jean-Guy Marcil said:
After you hit ALT-F9, you could have used the Find/Replace dialog to do it
even faster...
 
S

Stefan Blom

Find and replace should definitley work with field codes. Example, with
field codes displayed:

"Find what": STYLEREF 1 \s
"Replace with": STYLEREF "My custom style" \n

--
Stefan Blom
Microsoft Word MVP


in message
 
J

Jean-Guy Marcil

GwenH said:
Nope, tried that, and it didn't work.

I am sorry, but then it means you did something wrong.
I use Find/Replace to modify/update field codes all the time.
 

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