Thread: Radio buttons.
View Single Post
 
Old 07-21-2020, 10:23 AM
gmaxey gmaxey is offline Windows 10 Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

If you opt to stick with the ActiveX controls (which I don't recommend) and if the option buttons are in fact captioned "Yes", "No" and "NA" then:


Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oFld As Field
  For Each oFld In ThisDocument.Fields
    Select Case oFld.OLEFormat.ClassType
      Case Is = "Forms.OptionButton.1"
        If oFld.OLEFormat.Object.Caption = "No" Then oFld.OLEFormat.Object.Value = True
    End Select
  Next
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote