SOLVED

TC field code and TOC order

Copper Contributor

I have a document similar to the following:

{ TC "Level 1" \l 1 }{ TC "Level 2" \l 2 }Level 3          <-- style name = "myHeader"

 

TOC definition is:

{ TOC \f \h \z \t "myHeader,3" }

 

However, the TOC is appearing as:

        Level 3

Level 1

    Level 2

 

The only way I've found to get around this is:

{ TC "Level 1" \l 1 }{ TC "Level 2" \l 2 }          <-- the return at the end of this paragraph has to be hidden to avoid an empty line displaying before the "myHeader" paragraph

Level 3          <-- style name = "myHeader"

 

Is there a *proper* way to use the TC field in combination with a header so that the TOC entries appear in the right order? If not, is there a way to use my solution without having to manually hide the return at the end of the paragraph?

 

Thanks.

8 Replies

@lb483 Can you share a copy of the document so that we can investigate the issue.

Hi. This is the smallest document which demonstrates the issue :)

Example.docx

@Doug_Robbins_Word_MVP 

best response confirmed by lb483 (Copper Contributor)
Solution

@lb483 if, in the body of the document, you want all of the entries, that you want to appear in the Table of Contents, on a single line (which would be unusual to say the least), you need to have a Style Separator (CTRL+ALT+ENTER) between each of the entries.

Doug_Robbins_Word_MVP_0-1685484774981.png

 

@Doug_Robbins_Word_MVP 

Thanks. I'll give that a go. Bit of a niche requirement but if I don't put the TC fields on the same line as the myHeader text, I get an unwanted blank line in the output unless I make the return hidden - which is a pain.

@lb483 

 

You should be able to put a TC field at the end of an existing paragraph; that way, it shouldn't occupy any extra space (after you turn off the display of hidden text). 

The style separators worked, thank you. Annoyingly they're not available on Word for the Mac so I've had to move over to the PC but at least I have a solution.

 

Thanks @Doug_Robbins_Word_MVP 

Thanks. Unfortunately this puts the TOC entries in the wrong order (as per the o/p)

@lb483 

 

Thanks for the clarification. I missed the fact that you are adding both TC fields and styles in the table of contents. It was clear from your initial post; I apparently didn't pay enough attention to see it.
:(

1 best response

Accepted Solutions
best response confirmed by lb483 (Copper Contributor)
Solution

@lb483 if, in the body of the document, you want all of the entries, that you want to appear in the Table of Contents, on a single line (which would be unusual to say the least), you need to have a Style Separator (CTRL+ALT+ENTER) between each of the entries.

Doug_Robbins_Word_MVP_0-1685484774981.png

 

View solution in original post