But every time I reference Me.InlineShapes.Count ... I get zero.
Is there a way to do this in Word? Or am I totally hosed? If I could at least use an index like the reference suggests, then I'd be ok. I could write a function to loop through and return the proper index, but I can't even get that at this rate...
I have a few contingencies but they are less than ideal.
Sorry for asking such a simple question. Here's what I came up with in case anyone looks for this one:
InField is the name given to the ActiveX control within the document.
Public Function GetFieldIndex(InField As String)
Dim TotShapes As Long, i As Long, ObjName As String, _
ShapeName As String, ShapeType As String
i = 1
TotShapes = ThisDocument.Shapes.Count
Do While i <= TotShapes
ShapeName = ThisDocument.Shapes(i).Name
If ShapeName Like "Control *" Then
ObjName = ThisDocument.Shapes(i).OLEFormat.Object.Name
Else: GoTo NextObj
If ObjName = InField Then
GetFieldIndex = i
i = i + 1
For anyone confused like I was because of the post on stackoverflow, it turns out the InlineShapes member is supposed to cover ActiveX objects. However there is no name property so the above code idea won't work. I'm sure there's a way to parse for the index ID of a given ActiveX control using InlineShapes , but I used the Shape member instead and that also provided a way to filter out all other shapes except ActiveX text boxes, combo boxes, list boxes, buttons, etc..., thus avoiding errors.