Share via

Cannot get StyleRef to display immediately preceding Heading Style

Anonymous
2016-03-23T16:24:12+00:00

I am having fits with the StyleRef code today.  I created a StyleRef code in my document header, with one code linked to Heading 1's paragraph number (i.e., the "insert paragraph number" field option is ticked), and the second linked to heading 1.  On my first page, there are two instances of heading 1. However, on the next page, the StyleRef displays the first (and not the second, or immediately preceding) instance of heading 1 and does not display the text. And on the ensuing pages, the StyleRef displays the last instance of heading 1 on that page instead of the immediately preceding instance of heading 1, even though I have it in its default state (i.e., it is not set to search from bottom of page to top).   What on earth is going on here, and how do I fix it?

I have inserted a screen shot of the situation.  I have also inserted a screenshot of the field codes toggled.

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

Answer accepted by question author

Doug Robbins - MVP - Office Apps and Services 323.1K Reputation points MVP Volunteer Moderator
2016-03-31T22:03:02+00:00

The issue was that he wanted the StyleRef field on the second page to show the last heading (Sec. 27-721. - Applicability) from the previous page.  However, that is NOT the way that StyleRef fields work.   If there is text of the referenced style on the current page, it is the first instance of that text that will be displayed.  If there is NO text of the referenced style on the current page, then Word will look for text in that style, starting on the previous page and searching back to the beginning of the document.

If the \l switch is used, Word searches from the end of the current page to the beginning of the document, and then from the beginning of the following page to the end of the document.  It does NOT search from the end of the previous page if there is text of the referenced style on the current page.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

5 additional answers

Sort by: Most helpful
  1. Suzanne S Barnhill 278.1K Reputation points MVP Volunteer Moderator
    2016-03-23T23:19:35+00:00

    Your screen shot shows that you have some empty paragraphs. Check to make sure that they are not formatted with the Heading 1 style, which would result in a blank StyleRef field.

    Was this answer helpful?

    0 comments No comments
  2. Doug Robbins - MVP - Office Apps and Services 323.1K Reputation points MVP Volunteer Moderator
    2016-03-23T22:41:33+00:00

    Hi BuzzLS,

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

    Was this answer helpful?

    0 comments No comments
  3. Doug Robbins - MVP - Office Apps and Services 323.1K Reputation points MVP Volunteer Moderator
    2016-03-23T22:40:23+00:00

    Sagnik,

    There is absolutely NOTHING in either of those links that has the remotest connection to the issue raised by BuzzLS.

    PLEASE REFRAIN FROM RESPONDING WITH SUCH USELESS INFORMATION!

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2016-03-23T21:48:36+00:00

    Hello,

    Thank you for posting your query in Microsoft Office Community.

    As per your query, you may check the below thread which discusses about the same issue and check if it helps in resolving the issue:

    http://answers.microsoft.com/en-us/office/forum/office\_2013\_release-word/headers-and-footers-not-the-same-in-word-2013-from/28f184f8-ea4c-402d-8c56-786ea6c88d4d

    For more information, you can check the below Microsoft article and check:

    https://support.office.com/en-us/article/Create-a-bibliography-17686589-4824-4940-9C69-342C289FA2A5

    Hope this information helps. Please post to us if you need any further information with Office.

    Thank you.

    Was this answer helpful?

    0 comments No comments