Hello...
I hope this hasn't already been addressed... been searching for answers most of the day.
I am developing a non-profit training module for our volunteers. The module has 6 sections with a short multiple choice quiz at the end of each.
Since I copied the slides, the answer textbox is named the same on every slide. After submitting the answer, I disabled the box. If the user decides to redo the section he/she would need to select a button and every textbox in that section would be enabled and the answer within it emptied. Since it includes a lot of repetition I wanted to refer to the slide as an object. That in itself raised a different problem because I didn't create the slides in regular order and so for example, the 16th slide is numbered as "Slide19" in the VBA list of PowerPoint Objects. I have learned that there is a way to refer to Slide19 and also to slide(16).... not that this erases the confusion.
Here is the code I have so far...
Sub Reset2()
Dim osl As Slide
Dim myct As Integer
For myct = 38 To 42
Set osl = Me.Controls("Slide" & CStr(myct)) 'Me doesn't work - nor did anything else I tried here
With osl
.TextBox1.Value = "" 'doesn't recognize TextBox1
.TextBox1.Enabled = True
"do more stuff here"
End With
Next
End Sub
The following works.... but with all my slides it will be a lot of code, especially since I have only given you 2 items where there is actually a slightly longer list of "do more stuff". Any help to consolidate this code would be appreciated.
Sub Reset2()
With Slide38
.TextBox1.Value = ""
.TextBox1.Enabled = True
End With
Next
With Slide39
.TextBox1.Value = ""
.TextBox1.Enabled = True
End With
Next
With Slide40
.TextBox1.Value = ""
.TextBox1.Enabled = True
End With
Next
With Slide41
.TextBox1.Value = ""
.TextBox1.Enabled = True
End With
Next
With Slide42
.TextBox1.Value = ""
.TextBox1.Enabled = True
End With
Next
End Sub
Thanks
Gary