Hi Weste,
to the best of my limited knowledge,
controls form the control toolbox are
either shapes or inlineshapes.
So you might have to loop through all shapes
and inlineshapes and check their type.
Inlineshape controls are of type 5 (= wdInlineShapeOLEControlObject).
Here is an example for inlineshapes, in the doc's mainstory.
Sub test400()
Dim iShp As InlineShape
For Each iShp In ActiveDocument.InlineShapes
If iShp.Type = wdInlineShapeOLEControlObject Then
If iShp.OLEFormat.ClassType = "Forms.TextBox.1" Then
MsgBox "Control Textbox"
End If
If iShp.OLEFormat.ClassType = "Forms.ComboBox.1" Then
MsgBox "Control Combobox"
End If
End If
Next
End Sub
Note, that the comparison is case sensitive,
so "Forms.Textbox.1" won't work,
whereas "Forms.TextBox.1" does.
With shapes, which have to be converted from
inlineshapes to shapes programmatically beforehand,
things seem to be different, as they are
of type msoOLEControlObject,
which means, they are part of Office, not of Word.
Sub test401()
Dim oShp As Shape
For Each oShp In ActiveDocument.Shapes
If oShp.Type = msoOLEControlObject Then
MsgBox oShp.OLEFormat.ClassType
End If
Next
End Sub
HTH
--
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"