Discussion Locked

Selecting text in text boxes

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Does anyone know if there is a way to "select all" text in all the text boxes in a Word 2000 document? I have cross-references in many boxes and if you use "select all" under edit, the text within each box is not selected. I have to click on every text box 1 at a time, select all within that box and then use the F9 key to update the fields(page numbers) when I make a change to my document. This can be a long slow task. I have searched the net to no avail.

3 replies

by dklippert

Sub UpdateTextBoxes()
Dim S as Shape
For Each S in ActiveDocument.Shapes
S.TextFrame.TextRange.Fields.Update
Next S
End Sub

by reggie.lawrence

The answer above helped me, but I got errors when running it. This solution would work if every Shape defined in my Word document contained Text. I have Lines, Pictures, and Ovals to name a few which do not support Text. Anyway, I had to check each Shape using .HasText first. If the Shape contained text, then I would check for any Fields within that Text. If there were Fields, then I could do an Update without errors. Thanks anyway Doug for pointing me in the right direction.

This discussion is closed to new replies.