TextBox help

  • Thread starter Patrick C. Simonds
  • Start date
P

Patrick C. Simonds

Short question first.

Is there anyway to change/assign a number to a TextBox?

Why I am asking:

I am creating an automated form which will be filled in using VBA. I will be
using VBA to fill in among other things, place a X within a series of
TextBoxes. I am using TextBoxes to create squares to answer a series of
Yes, No, Sometimes questions. There are about 140 of these TextBoxes. The
TextBoxes number do not seem to fall in order so I am left to recording a
macro selecting the TextBox so I can get its number. This is very time
consuming.
 
B

Bear

Patrick:

Are you talking about a text form field (from the Forms toolbar) or a text
box control (from the Controls toolbar)?

If so, you can assign whatever identifiers you want to them, either numbers
or text that will help you remember what they represent.

The text form field bookmark can act as the index in VBA. For example,

Activedocument.FormFields("Text1").Range.Select

The text box control can be named however you like using the Properties
dialog box. It becomes an object in ThisDocument, and you can add code
relating to each event for the text box there.

Bear
 
Top