Please Note: This article is written for users of the following Microsoft Word versions: 97, 2000, 2002, and 2003. If you are using a later version (Word 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Word, click here: Finding Text Boxes.
by Allen Wyatt
(last updated February 9, 2019)
Word has a powerful search and replace capability that lets you search for virtually anything in your document. Word even includes codes you can use to search for special items. (Click the Special button in the Find and Replace dialog to see what codes are available.) One thing you cannot search for, however, is text boxes. There is no special code that allows you find text boxes, and you can't search for them using the Object Browser.
You can, however, use a macro to look through a document and stop when it finds a text box. The following macro stops on each text box it finds and asks the user if that is the text box wanted.
Sub SearchTextBox() Dim shp As Shape Dim sTemp As String Dim iAnswer As Integer For Each shp In ActiveDocument.Shapes If shp.Type = msoTextBox Then shp.Select Selection.ShapeRange.TextFrame.TextRange.Select sTemp = Selection.Text sTemp = Left(sTemp,20) iAnswer = MsgBox("Box contains text beginning with:" & vbCrLf _ & sTemp & vbCrLf & "Stop here?", vbYesNo, "Located Text Box") If iAnswer = vbYes Then Exit For End If Next End Sub
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (3520) applies to Microsoft Word 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Word (Word 2007 and later) here: Finding Text Boxes.
Do More in Less Time! Are you ready to harness the full power of Word 2013 to create professional documents? In this comprehensive guide you'll learn the skills and techniques for efficiently building the documents you need for your professional and your personal life. Check out Word 2013 In Depth today!
Text boxes are a great way to implement non-standard ways of laying out your document. They allow you to put text at ...Discover More
A sidehead can be used as a layout element for a document. You can create sideheads in a document by using text boxes, as ...Discover More
Text boxes can be a great aid in designing the layout of your document. What do you do when you can't find a text box ...Discover More
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Word that uses the menu interface (Word 97, Word 2000, Word 2002, or Word 2003)? This site is for you! If you use a later version of Word, visit our WordTips site focusing on the ribbon interface.