| Junior Member with 3 posts. THREAD STARTER | | | |
Word 2010 I have a Word 2010 document that contains three several ActiveX checkboxes. The checkbox names are CheckBox1 through CheckBox3. How do I set the Value of the checkboxes?
I've tried the following however, it doesn't work.
Sub ClearCheckBoxes()
Dim numCheckBoxes
numCheckBoxes = 3
Dim chkBoxNum As Integer
chkBoxNum = 3
Dim chkBoxString As String
Const constString = "CheckBox"
For cnt = 1 To numCheckBoxes
chkBoxString = constString & cnt
ActiveDocument.FormFields.Item(chkBoxString).CheckBox.Value = False
chkBoxString = ""
Next cnt
End Sub
The macro that followw works; however, it comes with some baggage. If I delete one of the check boxes, the index changes and the macro no longer works.
Sub ClearActiveX()
Dim num As Integer
num = 3
For cnt = 1 To num
ActiveDocument.InlineShapes(cnt).OLEFormat.Object = False
Next cnt
End Sub
I'd really like to use the Sub ClearCheckBoxes() macro above, but can't figure out how to make it work.
Any and all help will be greatly appreciated. |