vba make shape visible

M

MoWoL

I have been searching the posts, and have been unable to find the answer I'm
looking for. I have a presentation used as practice or test. I was able to
find code on randomizing my slides so it is different each time the user goes
through it. If they get the answer correct, the slide no longer comes up, if
it's wrong it stays in the random picking order so it will come up again
until they get it right. I couldn't be happier with the code I've found here
in helping me do this. One last thing I want to add... I have a text box that
says "previously missed". In code I have named this box "missed". In the
initializing frame, I loop through all slides and make this text box not
visible. The problem I'm having is making it visible for the next time it
comes up if they hit a wrong answer. I've tried using the on trigger event,
and that worked until putting in the code that randomized the slides. I'm
sure its all in the language, but I'm stuck. Any help would be appreciated.
Thanks.
 
A

Austin Myers

Post some of the code so we can see what you are trying to do. Makes it
much easier. ;-)



Austin Myers
MS PowerPoint MVP Team

Provider of PFCPro, PFCMedia and PFCExpress
www.playsforcertain.com
 
D

David M. Marcovitz

Once a shape is made invisible with code, animation won't help you; you
need to use code to make it visible again. Fortunately, the code for
making something visible is very easy as long as you can identify the
shape. In fact, it is the same as making it invisible, except you change
False to True. The details depend on how you are accessing the shape you
want to make visible. Here are a few examples:

oShp.Visible = True
makes the shape held in the variable oShp become visible.

ActivePresentation.SlideShowWindow.View.Slide.Shapes(3).Visible = True
makes the third shape on the current slide visible

ActivePresentation.Slides(4).Shapes(5).Visible = True
makes the 5th shape on the 4th slide visible

ActivePresentation.Slides(2).Shapes("missed").Visible = True
makes the shape named (with VBA code) "missed" on the second slide
visible.

There are many more variations, depending on exactly how you are able to
identify which shape it is that you want.

--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 
M

MoWoL

Thanks for the quick response guys, the following was exactly what I was
looking for:
ActivePresentation.SlideShowWindow.View.Slide.Shapes("Missed").Visible = True

When the user hits an incorrect answer, it fires the WrongAnswer() code that
first makes missed visible, then goes to the slide that tells them they
missed it. Most of my code I have adapted from David's site and postings.
I am now playing with keeping score, but for now this has helped
tremendously! Thanks again!
 
L

Larry Humphries

I used to use this trick all the time in ppt 2007. I would create an action setting on a word on the slide that would call a macro when the mouse hovered over a word. I would set the visibility to a particular shape to visible and others not, i.e.,

act.Shapes("CandlingSurfaces").Visible = False
act.Shapes("Holdup").Visible = True

This created an interactive presentation. However, this does not work in 2007. Only the shape that initially shows on the slide can be made visible or not visible. All other objects remain not visible unless I leave slideshow mode. Did something change?
 

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