Thread: [Solved] xml error .docm
View Single Post
 
Old 04-16-2018, 09:14 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,161
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

The concept of a group of checkbox content controls working in the same way as the old group of radio buttons (only allowing one active selection) is tricky to code. There may be a more elegant way to do this but my attempt is more flexible in supporting more than two options.
Code:
Private Sub Document_ContentControlOnExit(ByVal aCCactive As ContentControl, Cancel As Boolean)
  Dim aCC As ContentControl
  Select Case aCCactive.Title
    Case "MyCheck", "Q1"
      If aCCactive.Checked Then
        For Each aCC In ActiveDocument.SelectContentControlsByTitle(aCCactive.Title)
          aCC.Checked = False
        Next aCC
        aCCactive.Checked = True
      End If
  End Select
End Sub
Attached Files
File Type: docm Checkboxes.docm (24.7 KB, 77 views)
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote