PDA

View Full Version : Solved: If Content Control Checkbox is checked, uncheck others.... should be easy



brent.fraser
12-12-2012, 12:00 PM
After searching and searching, I can't find the answer I need for checkbox content controls. I see many for the legacy checkboxes but not for content controls.

What I am trying to do is have checkboxes act as option buttons and have it when one is checked, the other ones are not. Pretty simple. The cCheckbox names are "unsatisfactory", "adequate", "fine", and "grand".

Private Sub unsatisfactory_Change()
If unsatisfactory.Value = True Then
adequate.Value = False
fine.Value = False
grand.Value = False
End If
End Sub

I know this is what I think the logic should be but alas..... I don't know where to find the information.

I will have to do this six times because there are six categories of "options" that will have each of the above rating system.

Any suggestions?

thanks for the assistance.

Still searching for the answer.......

B.

brent.fraser
12-12-2012, 12:59 PM
I think I am close:


Private Sub unsatisfactory_Change()
Dim oCC_unsatisfactory As ContentControl
Set oCC_unsatisfactory = ActiveDocument.SelectContentControlsByTag("unsatisfactory").Item(1)
Dim oCC_adequate As ContentControl
Set oCC_adequate = ActiveDocument.SelectContentControlsByTag("adequate").Item(1)
Dim oCC_fine As ContentControl
Set oCC_fine = ActiveDocument.SelectContentControlsByTag("fine").Item(1)
Dim oCC_grand As ContentControl
Set oCC_grand = ActiveDocument.SelectContentControlsByTag("grand").Item(1)

If oCC_unsatisfactory.Checked = True Then
oCC_adequate.Checked = False
oCC_fine.Checked = False
oCC_grand.Checked = False
End If
End Sub


Still isn't working but I think I am close.

brent.fraser
12-12-2012, 01:12 PM
got it......:cloud9:

macropod
12-12-2012, 03:19 PM
FWIW, see: http://www.msofficeforums.com/word-tables/12335-assigning-values-check-boxes-calculating-results.html#post33489

brent.fraser
12-12-2012, 04:15 PM
Interesting. Thanks for the post and sample. I am doing an employee evaluation as well. It could server the purpose.

Happy day down-under.