Microsoft Word - ActiveX Controls - Asked By Christopher McKinnish on 06-Mar-12 06:11 PM

Using Microsoft Word 2007, I created a document with about 15 text boxes and labels.  I am trying to find out  
  1. Is a way that I can quickly get a list of all the text boxes and their descriptions?  Something that I could use to design a map, for lack of a better word, to define what each text box does.  Of course, I can just click on each one and write it down.  But there are going to be several of these, and it woudl be easier to copy a list. 
  2. Without having the text box with a visible border, is there a way to view or print all the text boxes on a form.

[)ia6l0 iii replied to Christopher McKinnish on 06-Mar-12 10:09 PM
For question 1, the following vba code would loop thru the textboxes in a document.

Dim shp As InlineShape
Dim tb
Dim textboxprogId As String = "Forms.TextBox.1" 

For Each shp In ActiveDocument.InlineShapes
If shp.OLEFormat.ProgID = textboxprogId Then
Set tb = shp.OLEFormat.Object
-- tb is the textbox. See its properties.
End If

And for your question 2, I think the answer is no.
Danasegarane Arunachalam replied to Christopher McKinnish on 07-Mar-12 12:57 AM
You can find the list of controls and their alternative text using the below code

Function GetTextboxs()
   For Each sh In ActiveDocument.Shapes
   'Loop through the shapes in the document
    If sh.Type = msoTextBox Then
   'Check for it is textbox
    'Get the Alternative Text
    Dim strText As String
    'Get the alternative Text
    strText = sh.AlternativeText
    End If
End Function