Toggle large group of ActiveX OptionButtons at once

dfoakley

New Member
Joined
Jul 16, 2013
Messages
3
I created a form in Word 2010 using many ActiveX OptionButton controls across numerous GroupNames. After configuring all of the buttons I went through and tested them to make they were all grouped properly; now a third are set to "true", but I want them to all be set to "false" before I distribute the form. Right now, I'm just going into the VBA code and toggling each of them manually. Is there a better way to do toggle them all as a single macro?

I tried the following procedure
Code:
Sub Reset()
    Dim oShape As Shapes
    
    
    Set oShape = ThisDocument.Shapes
    
    For i = 1 To oShape.Count
        If oShape(i).OLEFormat.ClassType = "Forms.OptionButton.1" Then
            If oShape(i).OLEFormat.Object.Value = True Then
                oShape(i).OLEFormat.Object.Value = False
            End If
        End If
    Next


End Sub
But it doesn't do anything. I also tried referencing oShape as an OptionButton, but that just generated a bunch of type mismatch errors.
 

Some videos you may like

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Watch MrExcel Video

Forum statistics

Threads
1,099,684
Messages
5,470,113
Members
406,681
Latest member
sachinmasurkar

This Week's Hot Topics

Top