A family of Microsoft word processing software products for creating web, email, and print documents.
Try using a STYLEREF field.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have a Word 2016 document with 6 sections in it. Each section contains 3 tables. It's possible for the tables to span more than one page. When they do, I'd like to repeat the section header at the top of the second page, with " (continued)" tacked onto the end of the header. I looked at "fields" for this, but I don't see that level of customization. Can anyone suggest what Word features I should use to create this effect?
***Post moved by the moderator to the appropriate forum category.***
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.
Try using a STYLEREF field.
One other thing that will give you a blank field is if there is an empty paragraph with your style.
If a StyleRef Field refers to text that has been marked as hidden, it will show as blank.
StyleRef field does not work with hidden text
Useful StyleRef tricks by Suzanne Barnhill (Figure 7)
In other words, if following the rules for which text is found by a StyleRef field, Word encounters text in the document that has been marked as hidden, it uses that text, but does not display it. It does not find the next instance of the style that is unhidden.
I believe that is the source of your problem.
Note that hidden text is not gone. It is there.
I generally have Word set to display hidden text. You have no control over whether or not the user displays hidden text.
I would urge you to explore Peter's work. I do not know if it will do what you want.
The problem existed when no sections were hidden. Changing the "bottom to top" option pretty much did the trick. Only the StyleRef field on the very first page doesn't display, because the first section doesn't have a header. I can live with that. I'll look through the links, though, I'll probably run across something I'll use at some point along the line. :-)
If you need to keep with the hidden text and Peter's calculation fields do not work for you, you could create some new hidden heading styles and have your macro change the style of your headings back and forth as it hides and unhides sections. It is more work than I would care to do but should work. Then the hidden text would no longer be formatted in the style that your StyleRef field is seeking.
***
Is this the same as Collapsed sections?
***
Hidden Sections aren't the same as Collapsed. I'm using the command
wrdDoc.Section(i).Range.Font.Hidden = True
***
If a StyleRef Field refers to text that has been marked as hidden, it will show as blank.
StyleRef field does not work with hidden text
Useful StyleRef tricks by Suzanne Barnhill (Figure 7)
In other words, if following the rules for which text is found by a StyleRef field, Word encounters text in the document that has been marked as hidden, it uses that text, but does not display it. It does not find the next instance of the style that is unhidden.
I believe that is the source of your problem.
Note that hidden text is not gone. It is there.
I generally have Word set to display hidden text. You have no control over whether or not the user displays hidden text.
I would urge you to explore Peter's work. I do not know if it will do what you want.