View Single Post
  #9   Report Post  
Posted to microsoft.public.word.docmanagement
pswiderski pswiderski is offline
external usenet poster
 
Posts: 7
Default Customized Layout for TOC

I understand better now, but it still isn't working for me.

Here's my steps. I've limited this to messing with one of the three styles
because I'd like to get that to work first and then worry about trying to get
all three in the TOC. So, I'm just referencing the "Rule x.yy" or "Actual
Rule" style here.

I set a style for "Rule x.yy". It is called "Actual Rule" and is a character
style based on the "default paragraph font" .
I placed my curser just after the text "Rule 1.01" and performed the
following key strokes:
Ctrl + F9
Typed: TC
Ctrl + F9
Insert | Field...
Selected STYLEREF and Actual Rule, clicked OK.

The results appear in the body of the document as:
{TC {Rule 1.01} } or if I Alt+F9 they appear as {TC {STYLEREF "Actual Rule"
\*MERGEFORMAT} }.

I go to the top of the document.
Go to Insert | Reference | Index and Tables
The TOC window opens and I select Options. I deselect the Styles and Outline
check boxes and select the Table Entry Field check box.

It goes back to my document and the TOC field reads as follows:
Error! No table of contents entries found. (the code reads: {TOC \f\p" "
\h\z})
I look at my TC code again and it has deleted the STYLEREF command. It
appears like this: {TC }

Please note: I tried many other ways. I typed the TC field out exactly like
you recommented with the " ". I placed it above the "Rule 1.01" paragraph.
Below this paragraph. Inside this paragraph.

Nothing seems to be working.

Thank you both for your advice. I really appreciate you taking the time to
explain this.

p

"Jay Freedman" wrote:

There's more to it than that.

The TC fields for "ARTICLE I" and "OFFICERS AND ELECTIONS" are fine, although
you might want to make them proper case instead of all caps. Also, unless you've
used an automatically numbered style for those paragraphs, you can omit the \n
switches because they aren't doing anything for you.

The TC fields for the rule number and section title should not be there, and the
StyleRef fields do not go at the top of the page. Instead, somewhere in the
paragraph following each rule number, insert a nested field with this content:

{TC "{StyleRef "Actual Rule"} {StyleRef "Section Title"}" }

Use Ctrl+F9 to create each matched pair of field markers, and be sure to place
the double quotes where I've shown them. While you're working on this, have the
nonprinting characters displayed by clicking the ΒΆ button, because TC fields are
automatically made hidden.

Repeat the same TC field (by copy/paste or by making the field into an AutoText
entry) in each rule paragraph. When you update fields (Ctrl+A, then F9), the
StyleRef fields will take as their values the text of the most recent occurrence
of the named styles -- even if there are more than one such occurrence on the
same page. You don't need any \l switches to make this work.

Another consideration: If the rule number is just the beginning of a larger
paragraph, make the Actual Rule style a character style instead of a paragraph
style. That way you can apply the Actual Rule style to just the "Rule x.yy"
text, leaving the rest of the paragraph in Normal or Body Text or whatever
you're using. The formatting can be the same or different; the only thing the
StyleRef field looks at is the style's name.

Finally, as Suzanne said, make sure the TOC options are set to pick up only TC
fields and not heading styles or outline levels.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all
may benefit.

On Wed, 16 Jul 2008 16:43:31 -0500, "Suzanne S. Barnhill"
wrote:

In order to get your TOC to pick up TC fields, you must check the box for
"Table entry fields" in the TOC Options dialog. You'll probably also need to
clear the check boxes for "Styles" and "Outline levels," given that you're
using built-in Heading styles (which have TOC outline levels by default) for
your headings.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

"pswiderski" wrote in message
...
Well, I guess I don't understand completely.
I create three new styles - Section Title, Rule Title and Actual Rule

Article I
Officers and Elections (assigned Section Title)

Presiding Officer (assigned Rule Title)

Rule 1.01 (assigned Actual Rule)


I places the following TC fields in the body.
ARTICLE I
OFFICERS AND ELECTIONS {TC "ARTICLE I" \n} {TC "OFFICERS ADN ELECTIONS"
\n}

PRESIDING OFFICER OF THE SENATE {TC "PRESIDING OFFICER OF THE SENATE"}

Rule 1.01. {TC "Rule 1.01" \n}

and I created
{STYLEREF " Section Title"}

{STYLEREF "Actual Rule"} {STYLEREF "Rule Title"\1}

at the top of my page.
I guess I don't understand how to get this to act as a TOC, (or to get
these
STYLEREF into the TOC field) or have a leader and page numbers after the
Rule
Title.
I also need to reference the "Rule Title" that is directly above the
"Actual
Rule" and not the one below it. I was trying to do this with the switch
\1,
but it doesn't seem to work.

Any advice would be greatly appreciated.

p



"pswiderski" wrote:

Wow. What a great article. Thanks.
I'm pretty sure the last topic is going to help me tremendously, but I'll
post again if I can't figure it out.
p

"Jay Freedman" wrote:

See the last section of
http://sbarnhill.mvps.org/WordFAQs/StyleRef.htm.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so
all may benefit.

pswiderski wrote:
I'm creating a TOC that needs to have both the Heading 2 and Heading
3 styles on the same line. Is this possible?
Example -
The body reads like this

Article I
Officers and Elections (these two lines are style = Heading 1)

Presiding Officer (this line is style = Heading 3)

Rule 1.01 The presiding officer shall be the president, blah, blah,
blah (the words "Rule 1.01 are style = Heading 2)

I need the TOC to read

Article I
Officers and Elections

Rule 1.01 Presiding Officer ...........................3
Rule 1.02 President Pro Tempore..................4

Is it possible to have both Heading 2 and 3 on the same line?
I've gone to the point, by manually altering the field code, that I
have Heading 1 correct and Heading 2 correct, but Heading 3 is on the
line above Heading 2 (because it appears in the text before Heading
2).

Maybe I need to use TC instead of TOC for Heading 3. If so, please
explain.

Thanks for your help.