Propagating a Variable

S

Skylab

I am still working on a Jeopardy game, and am using VB to keep track of
scores and team names.

I want to have on each slide the team name shown in an object. When you
start the game you enter the team name in a message box and it stores it in a
variable and displays it in a box on slide 4. My question is, can you take
that name they enter and make it output to an object that is on multiple
slides. Right now I am using the line:

ActivePresentation.Slides(4).Shapes("Team3Name").TextFrame.TextRange.Text =
Team3

But the object "Team3Name" is on multiple slides.

Do I have to make a script for each slide when they enter the team name or
is there an easier way? Thanks!
 
D

David M. Marcovitz

You have several choices. You could put a shape on the master slide and
put the team name in that shape on the master slide. You could make a
simple loop along the lines of (this is untested but it will give you the
basic idea):

For i = 3 to 10
ActivePresentation.Slides(i).Shapes("Team3Name") _
.TextFrame.TextRange.Text = Team3
Next i

You could quickly copy and paste your line and just change the 4 on each
line. You could loop through all of your slides check to see if the slide
contains a shape named "Team3Name" and put the name in there. Something
along the lines of (again, this is untested and more tenuous that the
previous code):

For Each sld in ActivePresentation.Slides
If sld.Shapes("Team3Name") Is Not Nothing Then
sld.Shapes("Team3Name").TextFram.TextRange.Text = Team3
End If
Next sld

That should give you some ideas. I'm sure there are many other ways to do
it.

--David


--
David M. Marcovitz
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/
 
S

Skylab

Thanks David! I just copied and pasted the code to match each slide. If you
want to see the finished product, you can send me a line at skylab at nohvis
dot com.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top