xHello -- in a PowerPoint 2003 presentation, I am trying to figure out how to
click a shape (say, a circle) to make another shape (a square) display in
slideshow view. I know I can easily do that with animation. However, in this
case I need to make the square appear and then display on all remaining
slides in the presentation. The circle may be clicked, it may not be, so no
way to tell at which point in the presentation the square should appear -- it
just needs to remain once it appears.
Can this be done with animation? If not, any direction on pulling this off
with VBA would be appreciated.
Thanks!
I don't think you can do this with animation. You certainly can do it with
VBA. You can either do it by putting the shapes on the slide master or by
putting them on every slide. The main problem with using the slide master is
that the way to access the slide master in VBA keeps changing with each new
version. If you want to do it on every slide, I would put the square on one
slide and name it (e.g., using Example 8.7 on my site). Then, I would copy
the square to every slide where I want it to appear. Let's say the shape is
named My Wonderful Popup. If you put it on every slide, you would need VBA
code something like (untested air code):
Sub ShowSquareEverywhere()
Dim oSld As Slide
For each oSld in ActivePresentation.Slides
oSld.Shapes("My Wonderful Popup").Visible = msoTrue
Next oSld
End Sub
You would probably need a similar procedure to hide the square (just
changing msoTrue to msoFalse). Now, if the square isn't on every slide but
just on select slides, you could either put some error checking in the loop
so it doesn't bomb if it doesn't find the shape on a slide and just goes on
the to the next slide, or you could specify the specific slides:
ActivePresentation.Slides(3).Shapes("My Wonderful Popup").Visible = msoTrue
ActivePresentation.Slides(4).Shapes("My Wonderful Popup").Visible = msoTrue
ActivePresentation.Slides(7).Shapes("My Wonderful Popup").Visible = msoTrue
ActivePresentation.Slides(10).Shapes("My Wonderful Popup").Visible = msoTrue
ActivePresentation.Slides(12).Shapes("My Wonderful Popup").Visible = msoTrue
That's pretty easy with copy and paste.
I'm sure there are about a million other ways to do this (e.g., Steve will
probably tell you to set tags for the slides with the square as you cycle
through).
The biggest issue you are going to have is figuring out when to trigger the
squares to hide again. The advantage of animations is that they reset
themselves when you start the presentation over. With the .Visible property,
that doesn't automatically reset. I usually accomplish this by having a
button on the first slide that does all the resetting (i.e., the same code
as above with msoTrue changed to msoFalse).
--David
--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland