Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word 2000 ActiveX Controls

Status
Not open for further replies.

lynnvictoria

IS-IT--Management
May 2, 2001
12
0
0
US
If I have added 3 ActiveX TextBoxes to a word document, How do I retrieve the names of those controls via a sub procedure? I have successfully counted how many fields I have in a document, but don't know how to return a name.

Help will be most appreciated.
 
Right click on the controls and select properties. You can see the name property at the top - which you should consider changing to something sensible...

To use the controls, go into vb (alt f11). To use the events of the controls - Double click on thisdocument in the project explorer window. Select textbox1 (or whatever you changed the name to) in the left hand combo box at the top of the screen. Select a suitable event in the right hand combo.

To grab the text stored in the text box, you'll want something like this...

Private Sub CmdGO_Click()
MsgBox txtName.Text
End Sub


 
Ignore me, I think I misread the question.

Why would you want to retrieve those names with VBA?

If you send me the document and let me know what you are trying to do, I'll try to help. c.hogben@ukonline.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top