question

dd88-5256 avatar image
0 Votes"
dd88-5256 asked StefanBlom-6438 commented

Insert TOC to use Heading Style TOC 3 only

Word 2016

I have an existing TOC in my document that use heading style TOC 1 & TOC 2.

I would like to create a custom TOC.
using TC field codes within a bookmark.
The TOC to use only the heading style TOC 3

this is my toc fieldcode

{ TOC \b bookmarkName \f \n \h \z }


When I create the fieldcode using either:
Insert ribbon, Quick Parts, Field, Index and Tables
or
References, Table of Contents, Custom Table of Contents ...

The toc inserted displays the content correctly.
However the TOC heading style by default is always TOC 1.

I would like the TOC heading to be TOC 3. This allows me to format TOC 3 differently.
I want to avoid writing code to update the custom TOC to use heading style TOC 3.

When I use the switch \ l
eg

{ TOC \b bookmarkName \l 3 }

the result - displays Error! Not a valid heading level range.

How can I do this.

TIA

office-word-itpro
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Stefan gave you the correct answer.
Here is my go-to page when I have questions:
TOC Tips and Tricks by Suzanne Barnhill, MVP


0 Votes 0 ·

@dd88-5256
Please refer to StefanBlom-6438 's reply.
Please also remember to accept his reply as an answer if it is helpful.


0 Votes 0 ·
StefanBlom-6438 avatar image
2 Votes"
StefanBlom-6438 answered

To create a TOC that references level 3 (Heading 3) paragraphs in a bookmarked range, use the following field code:

{ TOC \o "3-3" \b "BookmarkNameHere" \h }


The \h switch creates a hyperlinked TOC. You can omit that switch if you wish.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

dd88-5256 avatar image
0 Votes"
dd88-5256 answered StefanBlom-6438 commented

Thank you all

@ CharlesKenyon-8472 thank you I came across Suzannes detailed page

@StefanBlom-6438

this is my updated fieldcode

{ TOC \o "3-3" \b "bookmarkName" \f \n \h \z }

When I update the toc, the results are updates the fieldcode and TOC 1 heading style is still applied, and not heading style TOC 3



· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Try giving us a link to a sample document with the problem? Or use the paperclip icon to attach the file. Here is my article on why and how to do this.


0 Votes 0 ·

Make sure that you have a paragraph formatted in the Heading 3 style within the range defined by the bookmark.

As Charles wrote, you can provide us with an example so that we can have a look.

0 Votes 0 ·