Bug: Cross reference to heading text expands when content inserted or dropped before the heading

There is a nasty bug in Word that has been around since Office '97, and still exists in all versions up to Word 2013. It involves cross-references to Heading text. If I create a cross-reference to the text of a heading, and then I'm not careful about how I insert new content immediately before the heading, the new content gets included as part of the cross-referencing entry the next time you "Update Fields".

Causes

This happens if you: 

  1. Create a new paragraph immediately before the cross-referenced heading by putting the insertion point at the beginning of the heading and pressing ENTER, and then type, paste, or otherwise insert into the resulting new paragraph 
  2. Use Outline Mode to drag other content and drop it immediately before the cross-referenced heading. The entire extent of what is dropped gets included as part of the cross-reference, which can be extremely confusing as entire sections are now repeated inappropriately in the document.
  3. Paste content immediately before a cross-referenced heading

Example

The following image shows a Word doc with two headings, and the first paragraph after the first heading has a cross-reference to the Heading Text of the second heading. I have set Word to show a gray background for all fields, so the cross-reference has a grey background. This is how it is supposed to look:

The following shows what happens if I insert a paragraph before the "Another Heading" heading by the first method described above, and then "Update Fields":

The cross reference now incorrectly includes the newly inserted paragraph, as well as the originally cross-referenced heading.

This example was done using Word 2010, but Word 2013 still does the same thing. I've been living with this bug since Office '97. The only way to fix the problem seems to be to delete the Heading Text cross-reference and re-create it.

Outline mode is fantastic for re-arranging the order of sections in a document quickly, but this bug makes Outline mode useless if there are cross-references to any heading text in the document. The work around for Cause #1 (above) is easy: "don't do that", but this is a big training issue for our organization. The fact that this problem makes Outline mode and cut/paste dangerous for doc reorg is a real pain.

In order to see this happen clearly, I recommend setting Field Codes to display a grey background "Always". Go to File>Options>Advanced>Show Document Content>Field Shading>"Always".

I'd really appreciate it if this could be passed on to the MS team to get it fixed.

Thanks in advance...

Was this discussion helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this discussion?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this discussion?

Thanks for your feedback.

* Please try a lower page number.

* Please enter only numbers.

* Please try a lower page number.

* Please enter only numbers.

Cross-referencing by Heading uses the style attributes of the heading. Inserting a paragraph mark before a heading creates another heading in the same style, which is why your "bug" occurs. I would think if you selected the new paragraph mark and changed the style before doing anything else, you would eliminate the problem.
Author of "OOXML Hacking - Unlocking Microsoft Office's Secrets", ebook now out
John Korchok, Production Manager
production@brandwares.com

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

What you describe happens because Word makes use of hidden bookmarks for cross-references. Adding content or pressing Enter at the beginning of a cross-referenced (that is, bookmarked) paragraph simply expands the bookmark, and the result is that the cross-reference field points to the incorrect item. User-created bookmarks behave exactly the same way, which you can easily test (be sure to first enable the display of bookmarks in Word Options).

You avoid the problem by adding content at the end of the preceding paragraph instead. (There is no workaround for the problem in Outline view, as far as I know.)

I would call the problem a design flaw rather than a bug, but it would certainly simplify things if the behavior was changed. I suggest that you post a suggestion here: http://word.uservoice.com.        

Stefan Blom
Microsoft 365 Word MVP since 2005
Volunteer Moderator (Office)
MS 365, Win 11 Pro
~~~~
Please note that I do not work for Microsoft
MVP program info: https://mvp.microsoft.com/
~~~~

2 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Thanks for taking the time to reply John. Unfortunately changing the style of the new preceding paragraph does not prevent the problem. In my example I changed the style of the new preceding paragraph from Heading 1 to Normal before typing in the content, and the problem still occurred.

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Thanks Stefan. I posted on uservoice as you suggested, with a link back to the example here.

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

This isn't so much a bug as a poorly documented behavior (that is by design). It is fully described at http://www.thedoctools.com/index.php?show=wt_cross-reference_trouble. As Stefan says, a little care in creating content around referenced headings will avoid the problem.
Microsoft MVP (Word) since 1999
Fairhope, Alabama USA
http://ssbarnhill.com
http://wordfaqs.ssbarnhill.com
Screen shots captured with TechSmith's Snagit

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

If this is 'by design' then it's a very silly one.

Just look at what Word does when you add text at the end of the heading: this new text won't appear at the reference!

Now compare it to the way Table of Contents works - it also uses bookmarks 'around' headings but then it always behaves as expected!

Please understand that pasting copied text at the beginning of a paragraph (heading or not) is the easiest and commonest way of pasting before that paragraph and specially when we add text at the end of a paragraph we want it to be part of it :-)

10 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

What you can do is post a suggestion for future versions of Word in the UserVoice forum at http://word.uservoice.com.

Stefan Blom
Microsoft 365 Word MVP since 2005
Volunteer Moderator (Office)
MS 365, Win 11 Pro
~~~~
Please note that I do not work for Microsoft
MVP program info: https://mvp.microsoft.com/
~~~~

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

A similar problem occurs if you re-order sections using the navigation pane. In my view, whether it's a design flaw or a bug, it needs to be fixed. Chris
Cheers,
Chris

10 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Reordering Sections does not of itself cause the problem. It is caused entirely by the user adding content within an existing heading's range, thereby expanding the scope of the bookmark assigned to the heading. Once you've done that, changing Styles, etc. won't help - you need to re-assign the offending bookmark's range.
Cheers
Paul Edstein
(Fmr MS MVP - Word)

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

But Word itself does this ("adding content within an existing heading's range") to the heading of section X if you move another section Y just above section X using the Navigation pane or Outline view. This behavior cannot be intended by Word's designers because it adds zero value while causing major headaches for users ... like me :) ... who want to use the Heading text cross-referencing feature and use the Navigation pane or Outline view to reorganize their Word documents. Also, when heading X occurs at the very start of a document (a rare event I'll admit) or just after a table (not so rare) the user has to learn new tricks in order to add text just above Heading X without corrupting any Heading text cross-references to heading X.

Cheers,
Chris

5 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

* Please try a lower page number.

* Please enter only numbers.

* Please try a lower page number.

* Please enter only numbers.

 
 

Discussion Info


Last updated January 22, 2024 Views 3,115 Applies to: