Share via

Field code styleref

Anonymous
2019-10-16T07:42:10+00:00

I would like to ad a field code to my header with StyleRef to Heading 1 and Heading 6, depending on where you are in the document. 

E.g.: On page 1, Heading 1 is displayed -> Heading 1 in header

On page 2, Heading 6 is displayed -> Heading 6 in header 

Is it possible to to this with an IF statement without adding section breaks? 

I have tried this, but it doesn't work. Any tips?

{IF {STYLEREF "Heading 1" {IF {STYLEREF "Heading 6"}} }}

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

8 answers

Sort by: Most helpful
  1. Anonymous
    2019-10-16T13:34:43+00:00

    The StyleRef field, like most fields, is technology that has not changed for many years.

    You can use the Feedback mechanism in Word or UserVoice to request a change.

    I would not expect anything fast. If a change is made, it likely would not be in Word 2016 but in 365.

    https://word.uservoice.com/forums/304924-word-f...

    Please don't shoot the messenger! I am a fellow user trying to help you use the Office that is rather than the one that should be. If you assign a rating to my response, please rate my response, rather than what Microsoft is doing to all of us! The place to give feedback to them is through the feedback mechanism under File or UserVoice.

    The people who can make changes to Word seldom, if ever, read anything that is posted in this help forum.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Doug Robbins - MVP - Office Apps and Services 323.1K Reputation points MVP Volunteer Moderator
    2019-10-16T09:23:14+00:00

    In that case, I would just use a STYLEREF "Heading 1" in the first part of your document and have the Appendices in a separate Section (or Sections) of the document with the Header in that\those Section(s) of the document unlinked from that in the first Section (or Sections) so that you could then insert a STYLEREF "Heading 6" in the Header in the Section (or Sections) containing the Appendices

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2019-10-16T09:25:35+00:00

    Yes, that was also my first thought. But for a company template where some have limited word skills, where the appendices section is deleted, this would cause problems. Therefor it would be neat to combine this in a single code. 

    Any suggestions?

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2019-10-16T09:07:45+00:00

    Thanks. But what if the appearance of Heading 1 and 6 is random on all pages, not restricted to page 1?

    In my example Heading 1 is connected to the "main" document and Heading 6 is connected to subsequent "Appendices"

    Was this answer helpful?

    0 comments No comments
  5. Doug Robbins - MVP - Office Apps and Services 323.1K Reputation points MVP Volunteer Moderator
    2019-10-16T07:58:00+00:00

    You could do it with the following field construction

    { IF { PAGE } = 1 { STYLEREF "Heading 1" } { STYLEREF "Heading 6" } }

    That will display the text that is in the Heading 1 style in the header on the first page and the text that is in the Heading 6 style on the second and subsequent pages.

    Was this answer helpful?

    0 comments No comments