5 replies
by blamberson
'add this code
Dim strSlide as string
strSlide = Inputbox "enter the Slide number. eg Slide5'"
msgbox Slide5." & strSlide & ".Team1.Value"
by rwint
Did you try this? It did not work for me (two reasons)
1. There are a couple of syntax errors (I'm assuming) due to missing "()" around the inputbox command and the missing quote in front of Slide5" (I fixed this but the code still doesn't work)
2. "Slide5" (this is what I need to replace with a variable) is a powerpoint object. "Team1" is a textbox directly on the slide (not on a VB form). This control was added using the PowerPoint "Control Toolbox" icon on the "Visual Basic" toolbar (not using the powerpoint "Insert", "TextBox" menu options). I need the textbox to allow data entry during the slideshow which I am going to process further in the VB logic.
by blamberson
Sorry, I did not test it.
try this
Dim strSlide as string
strSlide = Inputbox ("enter the Slide number. eg Slide5")
msgbox Team1." & strSlide & ".Team1.Value"
by rwint
Let me try a different approach in explaining the issue.
1. I have a presentation slide full of shapes that simulates the Family Feud game show. Easch slide represents a different Family feud question (i.e. multiple slides).
2. Each Family Feud game slide has a VB text box so that during the slideshow the user can enter an answer.
3. Using VB code I check the users entries and reveal Family Feud answers until all are exposed.
4. I then move on to the next slide which starts the next Family Feud round.
5. The VBA code for each slide is the same, each slide with its own textbox (called Team1)
6. To read the textbox value into the VBA code I need to use the slide name (i.e. msgbox Slide5.Team1.Value)
7. How do I modify the Slide5 reference for subsequent slides.
8. Instead of returning me the textbox value/content, your solution returns "Team1.slide5.Team1.Value"
by rwint
I got my answer from another source (thanks for trying)
Sub xxSurveySays()
Dim intI As Integer
Dim intJ As Integer
Dim objTxt As Object
For intI = 1 To Presentations(1).Slides.Count
If SlideShowWindows(1).View.Slide.Name = Presentations(1).Slides(intI).Name Then
For intJ = 1 To Presentations(1).Slides(intI).Shapes.Count
If Presentations(1).Slides(intI).Shapes(intJ).Type = msoOLEControlObject Then
Set objTxt = Presentations(1).Slides(intI).Shapes(intJ).OLEFormat.Object
If Mid$(objTxt.Name, 1, 4) = "Team" Then
MsgBox objTxt.Name + " = " + objTxt.Text
End If
Set objTxt = Nothing
End If
Next intJ
End If
Next intI
End Sub
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending