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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word Table of Contents 1

Status
Not open for further replies.

MagicalDean

Technical User
Feb 16, 2005
61
GB
If I have a table of contents with this code
TOC \o "1-3" \h \z \u
It takes the styles Heading, Toc 1, Toc 2 and Toc 3. But how can I get it to ignore the first Heading style, because otherwise the first entry on the contents table is "Contents" on the Contents page, which makes little sense. Any help is greatly apprechiated
 
Hi MagicalDean,

Just change it to ..

[blue][tt] TOC \o "[/tt][red][tt]2[/tt][/red][tt]-3" \h \z \u[/tt][/blue]

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Sorry, I did phrase it badly. Is there any way to have it so just the first Heading style is ignored...but others are not? Or am I trying to be over complex with it?

(Ta for trying to help with that bit though! :))
 
In a generated ToC, if you get it to ignore first Heading style (and you can), then ALL first heading styles are ignored. As, I am assuming, the other chapter, sections, whatever, ARE using first heading style...this does not work for you, does it?

My assumptions may of course be wrong. The solution is to restate the problem.

The problem is you do NOT want "Contents" to be in the listed contents, correct? It is not to "ignore" first heading styles.

Here is the beauty of styles. Make a ContentsPage style that is exactly the same as TOC1. Make the text (paragraph) for "Contents" this style. It will look exactly the same as the other headings, but will not be included in the ToC - because it is NOT first heading style.

Gerry
 
Ahhh :) I see what you mean. I was basically trying to make the styles nice and neat by having the first Heading ignored so the Contents Heading is not in the Contents Table, but I guess theres little point as it seems quite complex :) I'll just create another style I think, I can see that being far simpler :)

Ta for your help!
 
I have the same thing at work. In some cases I want to have some of my level 3 headings included in the TOC, but not all. So, after I generate the TOC, I just delete those I do not want in the TOC, and unless I update the entire structure again, they stay that way.

Then, to prevent inadvertent rebuilding of the TOC, I select the TOC and hit CTRL + F11 to disable the update field. CTRL + Shift + F11 returns it to normal when I desire.
 
Again, use the power of Styles. I have all headings styles in two versions Heading 1 and Heading 1NoPrint (for example). Therefore when making the ToC, the NoPrint ones do not print, the others do.

On the other hand, most of the time, I never use the normal default ToC heading styles. You can make ANY style be the structure of a generated ToC.

For example, I have a book on Advanced Word techniques and VBA. MY ToC is generated using Styles

Insert > Reference > Index and Tables > Table of Contents tab. Then Options. All available styles are shown. Uncheck the defaults TOC1, TOC2 etc. You simply put "1", "2", "3" for the styles you want in your level structure. You can pick ANY style for the level structure.

This way, you make have absolute control of what styles are used to generate the ToC.

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top