Hide page number in Table of Contents

Anonymous
2018-07-11T18:52:52+00:00

I am working on a cookbook for my family. I have a Table of Contents that has 4 levels: TOC 1 = Chapter name, TOC 2 = a sub level of the chapter, TOC 3 = the name of the recipe, and TOC 4 = the name of the recipe indented.

Ex: 

Side Dishes ....................... pg 1  (TOC 1)

    Baked Vidalia Onion .......................... pg 1      (TOC 3)

    Potatoes........................................ pg 2     (TOC 2)

        Roasted Dijon Potatoes ............... pg 2      (TOC 4)

        Seasoned Grilled Potatoes ......... pg 3      (TOC 4)

    Tuna & Macaroni Salad .....................pg 4      (TOC 3)

Here's the problem: I don't want the page number to show on the 2 blue levels.

Ex: 

Side Dishes

    Baked Vidalia Onion .......................... pg 1

    Potatoes

        Roasted Dijon Potatoes ............... pg 2

        Seasoned Grilled Potatoes ......... pg 3

    Tuna & Macaroni Salad .....................pg 4

I can't find anyway to accomplish this. Does anyone know if there is any way to either delete or hide the page numbers on levels TOC 1 & TOC 3? Thanks in advance!

(Windows 10, Office 365 Home)

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Stefan Blom 323.1K Reputation points MVP Volunteer Moderator
    2018-07-11T18:57:08+00:00

    You can suppress the page number from a specific heading level by adding the \n switch to the table of contents field code. Press Alt+F9 to expose field codes. In place of the TOC, you will see something similar to (but not identical to) the following:

    { TOC \o "1-3" \h }

    Add \n "1-1" at the end of the field code as follows:

    { TOC \o "1-3" \h \n "1-1" }

    and press F9 to update the TOC. If prompted, choose to update the whole table.

    Finally, press Alt+F9 again to hide field codes.

    17 people found this answer helpful.
    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Jay Freedman 205.8K Reputation points Volunteer Moderator
    2018-07-11T19:33:33+00:00

    To hide page number for both level 1 and level 2, while still showing them for levels 3 and 4, the switch you add to the field code should be \n "1-2".

    2 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2018-07-11T19:54:49+00:00

    Thank you so much! That worked for the chapter level, but the sub chapter still had the page #.  I took a guess that the \n "1-1" should be \n "1-2" since the sub chapter is TOC 2 and now it is doing exactly what I wanted. Thanks again!

    0 comments No comments
  3. Stefan Blom 323.1K Reputation points MVP Volunteer Moderator
    2018-07-11T23:16:47+00:00

    Sorry, I overlooked the fact that you wanted to suppress the page number for levels 1 and 2. I'm glad you got it right. :-)

    2 people found this answer helpful.
    0 comments No comments