Results 1 to 8 of 8
  1. #1
    New Lounger
    Join Date
    May 2002
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cross Ref Shenanigans (Word 2000 sr 1a)

    Hi Folks,
    I am using Word's captioning and cross-referencing capabilities, and there is something happening (I won't call it a bug) that is driving me up the wall. I insert them using the Insert/Caption command, including chapter number, to produce a figure caption of the form "Figure 4.XX", where 4 is the chapter number. Within a paragraph use Insert / Cross-reference when I refer to it, such "as seen in Figure 4.XX". I have a separate style (called 'caption') for the figure captions., and use normal style for the paragraph text.

    The problem is that every now and then, for no reason, when I open the file the paragraphs containing the cross-references are changed such that everything prior to the cross reference is formatted with the 'caption' style, and separated from the automatic cross reference by a few paragraph marks. This occurs regardless of where the caption itself is located, either on the same page or elsewhere in the document. It does not happen for all cross references, but for several in a row. Manually changing the formatting to bring the paragraph parts together does not fix the problem, it goes back to the wrong formatting next time the file is opened. Removing the affected captions and cross-references and re-doing it all does fix it, but of course is tedious and does not prevent it from happening elsewhere in the document. Displaying field codes gives no hint as to why the paragraph formatting has changed.

    I have attached a sample file, with 2 such paragraphs.

    Any ideas?
    Attached Files Attached Files

  2. #2
    New Lounger
    Join Date
    Nov 2003
    Location
    Springfield, Virginia, USA
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Cross Ref Shenanigans (Word 2000 sr 1a)

    When I looked at the caption, I saw that the blank paragraphs just before the "Figure 2.1" caption text were also formatted with the Caption style. In the text, when the cross-reference is inserted, the blank paragraph marks are being treated as part of the "Only label and Number". If the style on the blank paragraph is changed to the Fig style, (or to any style other than the Caption style), the cross-references only pull in the "Figure 2.1" portion of the caption text.

  3. #3
    New Lounger
    Join Date
    May 2002
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Cross Ref Shenanigans (Word 2000 sr 1a)

    Yes, it appears that the formatting of the paragraphs before the caption are being included in the cross reference. Unfortunately the cross-reference is pulling in the formatting as well as the number of paragraphs marks between the caption and the previous paragraph - if I have 3 paragraph marks before the caption (leaving space for the picture), Word inserts 3 paragraph marks before the cross reference. Likewise if I have a page break before the caption, a page break is inserted as part of the cross reference. This is a big problem because there will always be at least one paragraph mark before the caption.

    Any ideas as to why this might be occurring, and why only to some of the captions?

  4. #4
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Cross Ref Shenanigans (Word 2000 sr 1a)

    What you are seeing is a result of you adding returns into the hidden bookmark after the cross reference is created. The problem is common because of the way Word puts in cross references and how it expands bookmarks.

    When you insert a cross-ref, Word puts an invisible bookmark around the origin (the Figure Number) and then creates a ref field (in your first case {REF _Ref55194187 h}) field in the location of the cross-ref. Note the name of the bookmark always starts with an underscore (which makes it invisible) and the number is randomly generated.
    Now Word will always display the contents of that bookmark whenever the fields are updated.
    The problem arises when you unwittingly edit the contents of that bookmark by placing your cursor at the start of the Caption line and pressing Return. This means the Return is now part of the bookmark and next time the fields are updated the cross-reference will reflect the contents of the larger bookmark.

    The way to avoid this problem in the first place is to be careful how you edit the document once you have created bookmarks. In this instance, if you put your cursor at the end of the paragraph above the hidden bookmark you could have added as many returns as you liked without a problem.

    There are two ways to fix this problem when it arises:
    1. Redefine the bookmark by revealing the field code of the cross reference and copying the _Ref###### string and then following the hyperlink to the caption and selecting the range Figure #.# and creating a bookmark with the name you copied to the clipboard. Then update the fields.
    2. Delete the extra returns inside the invisible bookmark by putting your cursor in front of the Caption and pressing BackSpace several times to undo the returns you added inside the bookmark. Now update the fields to see the cross reference has collapsed back down.

    You will get a better feel for this if you create some visible bookmarks and show them under Tools > Options > View. Now place your cursor inside the bookmark and add some text, place it at the start and add some text, place it at the end and add some text. Pay careful attention to which added text is inside the bookmark and which is outside it. This will help you avoid the problem in the future.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  5. #5
    Lounger
    Join Date
    Aug 2003
    Location
    Baltimore, Maryland, USA
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Cross Ref Shenanigans (Word 2000 sr 1a)

    I had posted same type of problem back in January 2002 and never got a suggestion/answer from anyone. I think we were using Word 97 then, now we're using Word 2K. Problem still crops up now & then but not nearly as often.

    Some cross refs go bad after they had been okay. Once we had one that went bad immediately and that made me think there may be a problem with the caption. Our cross refs usually come in the para before the graphic or table. When a cross ref. goes bad (and it does without anyone editing it) it reproduces the figure ahead of the caption (so you end up with a double graphic), and changes the style of the para its in to the caption style. When you select the bad cross reference, the extra graphic is also selected. If you delete the cross reference, the paragraph its in reverts back to its original style & alignment. Seemed to me at the time that bad cross refs seem to pick up the caption and everything in between (including page breaks if any exist) rather than referencing the caption. Wish I still had my example that I included with my post in Jan 02. Next time it happens, I'll check the code.

  6. #6
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: Cross Ref Shenanigans (Word 2000 sr 1a)

    Hi TernerM,

    I occasionally get similar behaviour with cross-referencing to headings also, mainly in documents that have many cross-references. It seems to be due to some random corruption of Word's internal bookmarking, because it often affects parts of a document where there hasn't been any editing ocurring immediately before the corruption occurs. The only solution seems to be to recreate the cross-references.

    Cheers
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  7. #7
    New Lounger
    Join Date
    May 2002
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Cross Ref Shenanigans (Word 2000 sr 1a)

    Thanks for the feedback.

    Now that I understand what has ben happening it has helped avoid further problems when shifting the figures around. I really can't avoid just deleting the affected caption though, and reinserting the cross references. The problem does seem to get worse with increasing complexity of the document, and I too have had figures become part of the cross-reference.

    Thanks for your help.

  8. #8
    Lounger
    Join Date
    Aug 2003
    Location
    Baltimore, Maryland, USA
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Cross Ref Shenanigans (Word 2000 sr 1a)

    We just had a perfectly good 178-page document with many cross references to figures and tables. Then we opened the document and printed it to the distiller to create a PDF file to send out for printing. During this printing, 3 cross refs went bad. I checked the codes and each one of the bad ones had * MERGEFORMAT at the end of the code, something we hadn't put in. None of the others had this switch; they just had the normal REF _Ref60641371 or similar number. Sometimes this seems to be triggered by printing, sometimes it just happens. Not too long ago, I had two cross refs to the same figure number go bad. I figured it was the caption, so I replaced the caption.

    This time, we had frames around a lot of graphics (loads of graphics) and these 3 had frames inadvertently anchored to the caption of the figure above. If I went into Normal view, I could see that all the captions that triggered bad cross references actually had ended up (because of positioning the frame) between another graphic & its caption. If I physically moved the graphic and its caption in normal view, the frame is removed and the cross reference straightened out. If I inserted a frame again, it invariably wanted to anchor to the caption of the figure before it (because usually the para I wanted to have wrap around it would only move up from the next page after I framed the graphic), so I gave the frame a position on the page and I could then move the anchor. Cross ref problem cleared up.

    This may not be the answer to all cross refs problems, but I have a feeling it may be the answer to a lot of ours.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •