Share via

Header in section TOC includes heading and section number (part of page number) for previous section, not current section

Anonymous
2023-08-24T03:30:19+00:00

I am writing a large document and the client wants:

  • At the start of each chapter, they want a TOC with all heading levels for that chapter. The header for each page of the TOC will have a table with:
    • Page number (chapter + page)
    • Heading 1 heading
    • “Table of Contents” (instead of the Heading 2 heading).
  • The header for each page (of content) will have a table with:
    • Page number (chapter + page)
    • Heading 1 heading
    • Heading 2 heading.

I have set Bookmarks for each section to enable me to create the TOCs for just that one section and am using Styleref fields of the heading names.

There is a section break between the section TOC and the section content so I can have a different header (the sections have a lot of headings so more than 1 TOC page). 

The TOC and content page headers for section 1 are correct.

The TOC header for section 2 is incorrect (it's using the section 1 information.)

The content page headers for section 2 are correct.

The structure should be:

Information Page Number in header should be... Current Status
Section 1 Administration & Policies TOC 1-1 Correct
Section 1 sub-headings and content 1-2, etc. Correct
Section 2 Training Procedure TOC 2-1 Incorrect<br><br>The header is Administration & Policies and the page number is 1-1
Section 2 sub-headings and content 2-2, etc Correct
Section 3 Heading 3-1 Incorrect<br><br>The header is Training Procedure and the page number is 2-1
Section 3 sub-headings and content 3-2 Correct

I’m not allowed to use macros. Is there anyway I can get this to work? If all else fails I’ll end up setting the header manually for the TOC pages for section 2 onwards.

(I have a demo document but I can't add it, and I have screenshots but I can't insert them for some reason)

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

7 answers

Sort by: Most helpful
  1. Doug Robbins - MVP - Office Apps and Services 322.9K Reputation points MVP Volunteer Moderator
    2023-08-26T08:48:45+00:00

    Where you say that the numbering is not correct, the issue is that the chapter does NOT start with a paragraph in the Heading 1 style.

     

    It is not until the third page of the Section that a paragraph in the Heading 1 Style is found.

    You will need to use Cross-references to the Heading Number and the Heading Text to achieve the desired result.

    2 people found this answer helpful.
    0 comments No comments
  2. Doug Robbins - MVP - Office Apps and Services 322.9K Reputation points MVP Volunteer Moderator
    2023-08-25T09:01:59+00:00

    If you send me a copy of the document, referencing this thread in the covering email message, I will investigate the issue.

    2 people found this answer helpful.
    0 comments No comments
  3. Doug Robbins - MVP - Office Apps and Services 322.9K Reputation points MVP Volunteer Moderator
    2023-09-01T01:38:07+00:00

    If you use Print Preview, it will update.

    Or run a macro containing the code

    With ActiveDocument
    .PrintPreview
    .ClosePrintPreview
    End With

    1 person found this answer helpful.
    0 comments No comments
  4. Anonymous
    2023-08-24T23:26:10+00:00

    Hi Stefan

    Thanks for your reply. I have a LOT of section breaks in the document - so before and after each TOC page.

    The challenge is that the actual page number is okay - it's the chapter number that's wrong. I've been able to upload some screenshots today so maybe this will show it better.

    First up is a split screen that shows the section 1 TOC page and the first page of the section 1 content. The information in both headers is correct.

    This section screenshot shows the same pages as above but I've pressed Alt+F9 so you can see the field codes.

    This screenshot shows a split screen with the section 2 TOC header (with a section break before) and the first section 2 content header (with a section break between them).

    The yellow highlighted fields are incorrect.

    This time the TOC header is using the Section 1 Heading 1 and chapter in the page number. (It should be page 2-1). Note that the TOC is correct because I set up a bookmark for the entire section 2.

    And the lucky last - the same 2 screens, but again I've pressed Alt+F9 so you can see the fields.

    I hope that explains the issue. Both TOC headers are set up the same and both content headers are set up the same, but section 1 details are correct. Section 2 details are incorrect.

    0 comments No comments
  5. Stefan Blom 339.2K Reputation points MVP Volunteer Moderator
    2023-08-24T06:36:57+00:00

    You can have page numbers reference the current Heading 1 style; the prerequisite is that headings have auto numbering applied to them.

    To restart the page numbering, you'll need a section break, at each of the locations where the restarts should occur.

    Use the Page Number Format dialog box to set the page numbering options. You will have to visit the dialog box once per section (Insert tab > Header & Footer group > Page Number > Format Page Numbers).

    Image

    If not all sections require a page number restart, select "Continue from previous section" in the dialog box for those sections.

    0 comments No comments