Word.Tips.Net WordTips (Menu Interface)

Find and Replace in Text Boxes

Margaret wrote about a problem she was having performing a find and replace for something in a text box. It seems that Margaret created a merged document, and then noticed that a reference number in a text box was incorrect. She tried to do a search and replace to change all instances of the reference number, but Word would not find and replace it.

In doing some testing, it appears that Word will find information in a text box and replace it just fine, provided that the text box is visible when you actual do the find and replace operation. For instance, if you place some text in a text box, and the same text in the main portion of the document, and then do a find and replace operation for a piece of text that is common to both the document and the text box, then Word will successfully replace all the instances—even those in the text box.

Why wouldn't Word find and replace the reference number in Margaret's situation? There are only a few possibilities. First, the reference number may not really be text. If the reference number was made with an embedded field, then the find and replace will not be reliable. For instance, if the reference number is created with the SEQ field, you can find what is displayed by the field, and you can replace it, but if the fields are updated (which happens when you print), then the "replaced" number reverts back to what the underlying field code tells it to be.

Second, if the reference number is linked in some way to another document (again, using a field), then Word cannot correctly replace the information. This is because the reference number is not in the current document, but in another document linked to the current document. To make the change, you would need to change the source document.

Finally, it could be that the reference number, if it was merged from another data source, contains some non-printable characters that make finding it impossible. For instance, let's say that the reference number you want to find is QR378, but that the text in the merge source includes a non-printing character of some sort between the "R" and the "3". If this is the case, then Word won't find the reference number when you search for QR378. The only way to correct this situation is to clean up the original data source and then run the merge again.

It should be noted that the discussion so far reflects the behavior of Word if you are replacing text using the Find and Replace dialog box. If you are actually doing the searching and replacing in a macro, it is interesting that Word won't find appropriate text matches in text boxes. You can, in fact, use the macro recorder to record a perfectly good Find and Replace operation—that does find and replace text in a text box—and when you later replay the macro, it won't find the information in the text box.

If you are doing searching and replacing in a macro, the following article by Doug Robbins on the Word MVP site explains what is going on:


WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (1331) applies to Microsoft Word 97, 2000, 2002, and 2003.

Related Tips:

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!


Leave your own comment:

  Notify me about new comments ONLY FOR THIS TIP
Notify me about new comments ANYWHERE ON THIS SITE
Hide my email address
*What is 5+3 (To prevent automated submissions and spam.)
           Commenting Terms

Comments for this tip:

Sandor VASONY    27 Jan 2016, 11:48
I would appreciate your help in the following problem concerning "Find and Replace" feature in Word 2013.

I have got about 300 frames in a Word 2013 document, exactly with the same positioning and frame datas.

I spent hours to try to find those frames, I specified all the possible datas of the frames what to find, but there is no success.

Could anyone send advices how to do this job, and what is the real cause of the situation?

Thank you, regards

Ken Endacott    04 Sep 2015, 07:07
Find and replace has many peculiarities. If you start with the cursor in the document body, it will search the document body as well as headers and footers and also all textboxes in the document body but not textboxes in headers and footers.

If the cursor is in a header (or footer) it will search just the text in that header (or footer) but not in any textboxes in that header (or footer).

If the cursor is inside a textbox then it will search only the text in that textbox.

Find & Replace run from a macro acts differently. If the cursor is in the document body then only the document body text is searched. This applies even if the macro has been recorded from a manual Find & Replace.

If you want to search every part of a document then a macro is needed to search the text in every StoryRange. Examples are given by Doug Robbins but Doug's macros only search textboxes in the main body not textboxes in headers, footers or other StoryRanges. Additional coding is needed to make sure that evert textbox is searched.
Bill    03 Sep 2015, 11:14
I had the same problem as Ralph, it does not search text boxes and selecting all (Ctrl+A) does not help.
Mihkel Kohava    26 Jun 2015, 05:53
Select all (Ctrl+A) and then use Find and Replace
Ralph    23 Jun 2015, 12:33
I had the same problem in Word 2013; searching for instances of a word that was located in text boxes throughout an unmerged document. (I only mention that it was unmerged because in your example the document was merged)

I had inserted text boxes in numerous locations in the document to help clarify the surrounding text. I just wanted to change the word "Project" wherever it occurred in the document with the word "Order".

Word 2013 found some instances of the word "Project" then reported that there were no more occurrences. It had missed more than half of them. I re-started the search from the beginning of the document several times, but to no avail.

I did discover that it would find them if I searched from within each text box, but of course, there were many text boxes, so that defeated the purpose of the search. Eventually, I replaced all the remaining occurrences manually.

Our Company

Sharon Parq Associates, Inc.

About Tips.Net

Contact Us


Advertise with Us

Our Privacy Policy

Our Sites


Beauty and Style




DriveTips (Google Drive)

ExcelTips (Excel 97–2003)

ExcelTips (Excel 2007–2016)



Home Improvement

Money and Finances


Pests and Bugs

Pets and Animals

WindowsTips (Microsoft Windows)

WordTips (Word 97–2003)

WordTips (Word 2007–2016)

Our Products

Helpful E-books

Newsletter Archives


Excel Products

Word Products

Our Authors

Author Index

Write for Tips.Net

Copyright © 2017 Sharon Parq Associates, Inc.