optionbutton values,how to set to false?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi NG
i have the following problem
In a loop, i want to cycle through all slides and all shapes on each slide and turn all optionbuttons off
(like a "reset the presentation" button
So far, I have

Private Sub CommandButton2_Click(
Dim myctrl As Contro
For Each sld In ActivePresentation.Slide
For Each shp In sld.Shape
If shp.Type = 12 Then 'the only way i found to identify optionbuttons is with this type valu
myctrl.Value = Fals
End I
Nex
Nex
End Su

But this doesnt work. Where am I going the wrong way
thank
Timo
 
Timon,

Dim oSld As Slide
Dim oShp As Shape
For Each oSld In ActivePresentation.Slides
For Each oShp In oSld.Shapes
If oShp.Type = msoOLEControlObject Then
' Check for type of control and set it's value to false.
If oShp.OLEFormat.ProgID = "Forms.OptionButton.1" Then
oShp.OLEFormat.Object.Value = False
End If
End If
Next oShp
Next oSld

Regards
Shyam Pillai

http://www.mvps.org/skp
 
Back
Top