G
Greg Maxey
A month or so ago I was studying and trying to understand Classes a
little better. I have a document with several option buttons that I
want to reset all the values to false. The following code is working,
but with the On Error statements, it will throw an errror if there is a
ActiveX listbox, etc. Also ActiveX text box values are set to "False"
when I run this code:
Sub ResetRadioButtons()
Dim oILS As InlineShape
For Each oILS In ActiveDocument.InlineShapes
If oILS.Type = wdInlineShapeOLEControlObject Then
On Error Resume Next
oILS.OLEFormat.Object.Value = False
On Error GoTo 0
End If
Next
End Sub
I have been unable to come up with any code that will determine "IF"
the wdInlineShapeOLEControlObject is an "OptionButton" Then ...
I was thinking that since the ActiveX OptionButtons are a Class (at
least I think they are) then I should somehow be able to work with the
collection of optionbuttons in the class. I can seem to get off the
ground with this.
Any ideas? Thanks.
little better. I have a document with several option buttons that I
want to reset all the values to false. The following code is working,
but with the On Error statements, it will throw an errror if there is a
ActiveX listbox, etc. Also ActiveX text box values are set to "False"
when I run this code:
Sub ResetRadioButtons()
Dim oILS As InlineShape
For Each oILS In ActiveDocument.InlineShapes
If oILS.Type = wdInlineShapeOLEControlObject Then
On Error Resume Next
oILS.OLEFormat.Object.Value = False
On Error GoTo 0
End If
Next
End Sub
I have been unable to come up with any code that will determine "IF"
the wdInlineShapeOLEControlObject is an "OptionButton" Then ...
I was thinking that since the ActiveX OptionButtons are a Class (at
least I think they are) then I should somehow be able to work with the
collection of optionbuttons in the class. I can seem to get off the
ground with this.
Any ideas? Thanks.