Trying to replace words with fields using Find/Replace

M

mbleyle

I have searched for an answer and apologize if it already exists...

I am trying to replace words in a document with a field after I have already
composed the doc. For example, assume I have written a book about apples,
and later decide that I want to substitute the word "apple" with a field,
whcih of course can carry the value "apple" or any other fruit I choose to
define.

Once my book has been written with thousands of literal "apple" words
throughout, what's the best way to replace those instances with my new field?

I have tried to force find/replace to do this but without success. Thanks
to anyone who helps out.

Mike
 
J

Jay Freedman

Hi Mike,

Here's the simplest way:

Create the field. It could be a Ref field pointing to a bookmark, or a
DocProperty field pointing to a custom document property (or, less likely, a
DocVariable field; you need a macro to set the value of a document
variable). Select the field and copy or cut it to the clipboard.

Put the cursor at the beginning of the document and open the Replace dialog.
In the Find box, enter the word or phrase to replace. In the Replace box,
enter the code ^c (or click More, click Special, and select "Clipboard
Contents", which inserts the same code). Click the Replace All button.

You'll probably have to select all text in the document (Ctrl+A) and update
the fields (F9).

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top