I'm trying to change the format of a hyperlink cross reference to the typical blue underlined text. I tried following the instructions at this site: http://wordfaqs.mvps.org/formatcrossreferences.htm which recommends using the \*Charformat switch.

To make a global change the site recommends using Find and Replace with these parameters: Find: REF * \\h
Replace: ^&^c (where *Charformat was previously copied to the clipboard and the desired format is selected under the Format dropdown box)

When I follow these instructions the Ref field takes on the blue underlined format I want but when I hit Alt+F9 to hide the field codes the result is still a plain text cross reference.

I would really appreciate it if anyone can help me understand what I'm doing wrong.


If your REF fields have all been inserted in the standard way, i.e. with a space between the { and the "REF", then go through the process again, but in the FInd: box, put a space before the REF, i.e. use

" REF * \\h"

(but without the double quotation marks)

That should apply the formatting you want to (almost) all of the text starting at the first space.

This problem is the result of an oddity that appeared in Windows Word 2007 I think. If you only have (say) English and other western European languages enabled in Word, applying the formatting to the "R" of "REF" should be enough. If, however, you enable certain other languages, you must have a space before the "REF", and you must format that space the way you want (the formatting of the "R" is ignored". SO Using " REF" and ensuring that both the space and the R are formatted as required should be enough. Typically, it is easiest to select the whole field and apply the formatting.

"other languages" certainly include languages that use RTL scripts, and Hindi, which leads me to suspect that it may be "any language that uses a non-Latin script". But I haven't checked extensively.

The definition of how \*Charformat is supposed to work has always been ambiguous. Early Word documentation talked about applying the formatting to the first character in the field, but at that time, Word did not insert a space before the field code name by default. So the first character would have been the R. Even the .docx standard documents do not clear it up completely (unless they have done so in the 2012 version.

  • Thank you for your response and apologies for the delay in getting back to this. I was having trouble because I had 'Ref' rather than 'REF'. So for example one of my fields is { REF _Ref393192451 \h}. When I searched for 'Ref * \\h' or ' Ref * \\h' nothing was found but I don't understand why it wouldn't have found 'Ref393192451 \h'. Do you have any thoughts on this? When I searched for 'REF * \\h' it found the string starting with REF and when I searched with ' REF * \\h' if found the string starting with the space then REF. So, I can get this to work but I don't understand the above. – mchac Jul 16 '14 at 0:38
  • Also, I do indeed need to format the space before the 'REF' in order for * Charformat to have effect. Thanks for that. – mchac Jul 16 '14 at 1:17
  • I don't know why your other "finds" did not work, unless for example the "whole words only" option was in play, the ignore case option was disabled, etc. AIUI some options can be left switched on after a previous find. The search for just the "Ref39192451 \h" would need \\h rather than \h, but I suspect that is just a typo. – user181946 Jul 16 '14 at 7:02
  • I've just now been trying it again and I get the same behavior. The "Ref39192451 \h" is part of the actual field that I thought would be found. I wasn't searching using that string in the Find field. It seems to me that Find using 'Ref * \\h' should locate that part of the field but no. If I change to 'REF * \\h' it works fine and finds 'REF _Ref393192451 \h'. Then of course * Charformat didn't work ... so i beat my head against the keyboard for a while then realized I missed the space before REF (as you mentioned). Use Wildcards is activated. All of the rest of the options are off. Argh – mchac Jul 16 '14 at 12:15
  • I have started to get confused by what you are trying, so sorry if I have misunderstood, but...A search for 'Ref * \\h' will not find 'Ref39192451 \h' because of the space before the * - i.e. to find that, you would need to search for 'Ref* \\h', I think. – user181946 Jul 16 '14 at 13:34

I ran into this issue for a new employer.

Retain the extra spaces in the find/replace fields. They're needed to make this work properly.

Find what: ( REF )(_Ref[0-9]{1,9})( \h )

Select Use wildcards

Replace With: \1 ^92*Charformat \2\3

Note: There's an extra space before REF, so it's actually, " REF"

The ^92 is a required backslash to make that *Charformat work.

Set the Style of the Find What to the font color and underline from Format>Font. Don't use a defined style.

Refer to the image

MS Word Find and Replace dialog with the example settings

Works in MS Word 2013 and above, and probably 2010, too.

Note: If you've applied the formatting and it seems not to work, make sure that *MERGEFORMAT is not present in the field. That prevents the formatting from appearing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.