Good Afternoon - depends on when you read this,
I have a document with 100 checkboxes and beside each checkbox is a combobox,
If I currently have selected a checkbox, how can I select the adjacent combobox?.....It's a little more complicated than wdExtend I think; here is my code:
'searches document for all inlineshapes
For Each ml in ActiveDocument.InlineShapes
'if the left 2 characters of the object is gr, check it's value, if it's value is true (i.e. checked) continue
If Left(ml.OLEFormat.object.name, 2) = "gr" Then
If ml.OLEFormat.object.value = True Then
'searches document for all inlineshapes beginning with aa and adds the caption of the checkbox to the combobox
For Each sh In ActiveDocument.InlineShapes
If sh.Type = 5 Then
If Left(sh.OLEFormat.Object.Name, 2) = "aa" Then
NEXTCOMBOBOX.AddItem sh.OLEFormat.Object.Caption
End If
End If
Next
End If
End If
Next
I hope everything made sense.
Thanks In Advance,
NoChoice
I have a document with 100 checkboxes and beside each checkbox is a combobox,
If I currently have selected a checkbox, how can I select the adjacent combobox?.....It's a little more complicated than wdExtend I think; here is my code:
'searches document for all inlineshapes
For Each ml in ActiveDocument.InlineShapes
'if the left 2 characters of the object is gr, check it's value, if it's value is true (i.e. checked) continue
If Left(ml.OLEFormat.object.name, 2) = "gr" Then
If ml.OLEFormat.object.value = True Then
'searches document for all inlineshapes beginning with aa and adds the caption of the checkbox to the combobox
For Each sh In ActiveDocument.InlineShapes
If sh.Type = 5 Then
If Left(sh.OLEFormat.Object.Name, 2) = "aa" Then
NEXTCOMBOBOX.AddItem sh.OLEFormat.Object.Caption
End If
End If
Next
End If
End If
Next
I hope everything made sense.
Thanks In Advance,
NoChoice