Wednesday, March 20, 2019

Fixing the Expanding Cross-Reference Bug in Word

Not long before I left the TMX, I ran into an interesting problem with a Word document. It was large (around 200 pages) and complex, with many sections and subsections and cross-references to them. It was probably the messiest document I worked in my entire time at the exchange.

The poor business analyst who owned the document's content came to me one day and said that the document was acting weird. Text was appearing, apparently randomly, where it shouldn't have been.  I had seen this problem in the past, but thought that Microsoft had fixed the bug in Word 2013. Cross-references were pulling in the text from the section they were referencing. I deleted the text and rebuilt the cross-references, only to find a few days later that the problem was occurring again.

After doing some research, I found the apparent cause of the problem. It can happen when 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.
It's not exactly a bug, but a consequence of how Word creates cross references by using hidden bookmarks. It's also worrisome, because it can be easy to miss in larger documents. Making sure that you make fields always visible can help to you to spot it when it occurs.

The article, Cross-reference Problems – Troubleshooting on the DocTools.com website has more details (including listing some other circumstances when it can happen) along with information about a tool that can fix the problem.

No comments: