Welcome toWord.Tips.Net
Ask a Word Question
Make a Comment
Learn Access Now
Free Printable Forms
Beauty Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Legal Tips
Money Tips
Organizing Tips
Pest Tips
Pet Tips
Wedding Tips
Word2007 Tips
WordTips
Setting Fraction Bar Overhang Spacing in the Equation Editor
Printing On Both Sides of the Paper
Turning Off AutoComplete for Dates
Understanding Auto Line Spacing
Adding Comments to Your Document
Conditional Calculations in Word
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
Tip #3520 applies to Microsoft Word versions: 97 2000 2002 2003 2007
Document and Annotate! One of the easily overlooked tools provided by Word is the ability to add footnotes and endnotes to your documents. WordTips: Footnotes and Endnotes is the definitive resource guide to using these tools to enhance your documents.