Search for textboxes

A

andreas

I recently moved a text box around in a word file and somehow it
disappeared. Can I ask Word to search for text boxes in a document via
VBA?

Help is appreciated. Thank you very much in advance.

Regards,

Andreas
 
J

Jezebel

Textboxes are in the Shapes collection. Since this is just a one-off, you
can probably find it using these commands in the commands in the Immediate
window --

? ActiveDocument.Shapes.Count to find out how many shapes there
are (not just text boxes)

and

ActiveDocument.Shapes(n).Select to select the nth shape ... just
work your way through from 1 to however many there are until you find your
missing one.
 
K

Klaus Linke

ActiveWindow.ScrollIntoView Selection.Range, True

....might also come in useful, because Word won't necessarily scroll a Shape
into view automatically when you select it.

Regards,
Klaus
 
A

andreas

Textboxes are in the Shapes collection. Since this is just a one-off, you
can probably find it using these commands in the commands in the Immediate
window --

? ActiveDocument.Shapes.Count to find out how many shapes there
are (not just text boxes)

and

ActiveDocument.Shapes(n).Select to select the nth shape ... just
work your way through from 1 to however many there are until you find your
missing one.







- Zitierten Text anzeigen -

ok, thank you Jezebel
 
A

andreas

ActiveWindow.ScrollIntoView Selection.Range, True

...might also come in useful, because Word won't necessarily scroll a Shape
into view automatically when you select it.

Regards,
Klaus







- Zitierten Text anzeigen -

Good advice, thank you.
Regards,

Andreas
 

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