TL;DR: Cross-References to the Heading Text of a Heading-styled paragraph are incredibly fragile and don't survive in the real world where users edit text. Terrible workaround: Make all edits to the non-last word in the heading-styled paragraph. How can we simply and reliably cross-reference heading text in an environment where users are not Word experts?
Hi. This one is a doozy from a user-experience perspective, because it's really hard to justify this behaviour. Users of this template must be able to create cross-references to procedure titles within the document. Procedure titles are Heading 7. Headings are not (and will not be) numbered in this template.
The Task column will be numbers representing the order of operations. The Procedure column will contain the Procedure Title. You can guess what the Page column is for.
Expected workflow: User places cursor in the Procedure row > References > Cross-reference > Reference type=Heading > For which heading=Procedure Title > Insert reference to=Heading Text; repeat for Insert reference to=Page number.
We get Error! Reference source not found. Arrgh.
Similar problems have been resolved by making the cross-reference to Reference type=Numbered Item/Insert reference to=Paragraph text. However, these headings will not be numbered, so that's not an option.
Trial, error, and XML have revealed an unexpected behaviour. The cross-reference to Heading Text appears to be not to the heading text, but to the range of the heading text that was present when the bookmark was initially created. If it's changed in any way other than something ridiculously specific for the real world, the range does not update and the bookmark will fail.
Everything is wonderful.
Now we update the Procedure Title to New Text and update the references. (For sake of reducing the screen cap volume, I'm only updating and screen capping the reference to Heading Text. But it's the same basic problem for the reference to Page Number even though the error text is now inexplicably worded Error! Bookmark not defined..)
This is stupid. Everything that identifies this range as a bookmark is gone. A user expects to be able to update text and references to the text should not be destroyed – or in this case, the reference anchors should not be destroyed. Those bookmarkStart and bookmarkEnd tags surround the range, but edits to the range text level destroy their surroundings. Whatever technical justification there may be for this is irrelevant* because the user experience is utterly terrible.
*Example: When editing existing text, a new range is created to hold the edits and an rsidR identifies the individual edit range for change tracking and doc merging purposes. But the bookmarkStart and bookmarkEnd tags do not surround the net range, which is what a user would expect – they remain statically wrapping the remnants of the original range.
I found a circumstance where this works as one might expect! (the "something ridiculously specific" I mentioned an hour ago). If the user edits or replaces existing non-last words, it works. It also works when edits are prepended to the last word. (See green highlights.) BUT! If changes are appended to the last word, the last word is replaced, or new text is added after the last word, it falls outside the range and fails. If the text is entirely replaced (as above), the entire range is replaced. The bookmarkStart and bookmarkEnd do NOT react well to changing real-world usage as a normal human being would expect.
So… what's the simple and reliable answer to cross-referencing heading text? Do I tell users to re-create the cross-reference every time they update the heading text? They (almost) might as well not make cross-references then.
BTW thanks for listening to me rant. :-)
PS: A TOC isn't the answer. The order in which each Procedure Title is listed in the document isn't necessarily the order in which they'll be listed in the table. The tasks involved in changing a car's tire are identical; the order of the tasks determines whether you're taking the tire off or putting it on.