A family of Microsoft word processing software products for creating web, email, and print documents.
Doug, maybe I'm missing something, but I would expect your nested fields to work only if Heading 4 is missing completely from the document?
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Dear community,
I would like to create a conditional styleref for the header.
The condition is as follows, if a Heading 4 does not exist within the section, then use another one(e.g. Heading 2).
I have tried to figure out myself writing this conditional script:
{IF{STYLEREF "Heading 4"}= "Error!*" {STYLEREF "Heading 2"} {STYLEREF "Heading 4"}}
But it does not work.
Where is my mistake:
Is there some important spacing, special bracketing and etc.?
Thank you.
BR,
Mihail
A family of Microsoft word processing software products for creating web, email, and print documents.
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.
Answer accepted by question author
Doug, maybe I'm missing something, but I would expect your nested fields to work only if Heading 4 is missing completely from the document?
Answer accepted by question author
Answer accepted by question author
The STYLEREF field would only display an error if there is no paragraph at all using the referenced style, so the conditional field isn't going to work.
What you can do is create a character style; in sections where Heading 4 exists, apply the character style to the Heading 4 paragraph. In each section where there is no Heading 4, apply the character style to the appropriate Heading 2 paragraph instead. This would be a "semi-automatic" solution, of course, and in a long, complex document it may be difficult to maintain.
Dear Stefan, Doug,
Everything works!
The first mistake was that I have considered this as a script, but this works more like text replacing.
So, the mistake was exactly because of this.. There should be no any extra spacing in {STYLEREF "Heading 4" ...}, otherwise it cannot
coincide with the error messaging.
Thank you and wish you good time!