![]() |
#2
|
||||
|
||||
![]()
It would be a start if you didn't have multiple checkboxes each named Checkbox1 or Checkbox2. They need to be uniquely named for the type of code event you are planning to work.
Then you will need to adjust your main code if you want the other checkbox pairs to work in a similar fashion. Your checkbox entered is in the wrong Case selection group. It should be in the main group relating to CC Code:
Case "Checkbox1" If CC.Checked = True Then ActiveDocument.SelectContentControlsByTitle("Checkbox2").Item(1).Checked = False ActiveDocument.CustomDocumentProperties("Chk1").Value = 1 ActiveDocument.CustomDocumentProperties("Chk2").Value = 0 Else ActiveDocument.SelectContentControlsByTitle("Checkbox2").Item(1).Checked = True ActiveDocument.CustomDocumentProperties("Chk1").Value = 0 ActiveDocument.CustomDocumentProperties("Chk2").Value = 1 End If ActiveDocument.Fields.Update Case "Checkbox2" If CC.Checked = True Then ActiveDocument.SelectContentControlsByTitle("Checkbox1").Item(1).Checked = False ActiveDocument.CustomDocumentProperties("Chk2").Value = 1 ActiveDocument.CustomDocumentProperties("Chk1").Value = 0 Else ActiveDocument.SelectContentControlsByTitle("Checkbox1").Item(1).Checked = True ActiveDocument.CustomDocumentProperties("Chk2").Value = 0 ActiveDocument.CustomDocumentProperties("Chk1").Value = 1 End If ActiveDocument.Fields.Update End Select End Sub You may find Insert Content Control Add-In useful as a means of editing the controls (including the list box to remove the unwanted placeholder text). Note that you don't need the module relating to Word 2007 compatibility. Word 2007 is not compatible with check box content controls, that were introduced with Word 2010.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com Last edited by gmayor; 08-19-2023 at 10:59 PM. |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Strogg | Word | 3 | 02-10-2019 11:45 AM |
VBA in Word 2010 to show certain text only when a YES checkbox is checked | kdsim | Word VBA | 0 | 05-16-2018 05:16 AM |
Check Box Content Control when checked users are presented with an option | cryder | Word | 0 | 01-07-2016 05:11 AM |
how to show total of check boxes checked | worder | Word | 16 | 03-10-2014 05:07 PM |
Word2010 check boxes and plain text content control boxes in same table | fcsungard | Word | 5 | 06-01-2012 01:16 AM |