Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2008

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
GwenH - 25 Feb 2008 16:51 GMT
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
Jean-Guy Marcil - 25 Feb 2008 17:50 GMT
> I have a document with multiple chapters. The first page of each chapter has
> this:
[quoted text clipped - 12 lines]
>
> 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.
GwenH - 25 Feb 2008 19:55 GMT
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

> > I have a document with multiple chapters. The first page of each chapter has
> > this:
[quoted text clipped - 25 lines]
> previous Heading 1 number and {STYLEREF 1 } to display the previous Heading 1
> text.
GwenH - 25 Feb 2008 20:36 GMT
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

> 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,
[quoted text clipped - 38 lines]
> > previous Heading 1 number and {STYLEREF 1 } to display the previous Heading 1
> > text.
Jean-Guy Marcil - 26 Feb 2008 13:36 GMT
> 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
[quoted text clipped - 5 lines]
> 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...
GwenH - 26 Feb 2008 16:30 GMT
Nope, tried that, and it didn't work.

Gwen H

> > 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
[quoted text clipped - 8 lines]
> After you hit ALT-F9, you could have used the Find/Replace dialog to do it
> even faster...
Stefan Blom - 27 Feb 2008 09:50 GMT
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

Signature

Stefan Blom
Microsoft Word MVP

> Nope, tried that, and it didn't work.
>
[quoted text clipped - 19 lines]
>> it
>> even faster...
Jean-Guy Marcil - 27 Feb 2008 15:18 GMT
> 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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.