How to do search and replace involving fields in Microsoft Word?

user663031 picture user663031 · May 23, 2012 · Viewed 27.8k times · Source

I have a Word document with fields of the reference variety, which occur in the form "[field].[field]"--in other words, there's a period between the two fields. I want to globally replace this with a space.

Word offers the ^d special character to search for fields, but for some reason the query "^d.^d" does not find anything. However, ".^d" does. Now comes the problem, however--what do I specify as the replacement text in order to retain the field code? If using regular expressions, I could use a "Find What Expression" such as \1, but with regexp ("wild card") mode the ^d is not permitted.

I guess I could write a macro...

Answer

Alexandru Cobzaș picture Alexandru Cobzaș · Dec 11, 2013

I would like to add to Bibadia's solution.

An example of an index entry field; we want to change a name we misspelled.

  • Make sure hidden formatting is displayed (toggle with SHIFT+CTRL+F8).
  • Make sure wildcards option is not selected. To search for fields, use the opening and closing field braces code (optionally use ^w for spaces, as Bibadia suggested):

    ^19 XE "Deo, John" ^21

  • Replace won't recognize field braces character, but will allow to insert the clipboard's content. ;). To do that, insert in text the correct entry. CTRL+F9 to insert field and type:

    XE "Doe, John"

  • Select the field above and copy

  • Use

    ^c
    in the replace box

  • Hit Replace All

Ta-da!