Hi, I'd like to be able to delete a shape from the presentation/viewer screen
by selecting the shape and clicking on it. The screen will have lots of
shapes, and I want to be able to select any one of them to a make them
disappear (which is why I can't do this using the animation). Is there a way
to set up a macro or VBA to do this? I'd appreciate any help. This is for a
classroom game/demonstration.
As John said, this is definitely something that you can do without VBA.
Trigger animations are perfect for this. If there is some other reason you
need VBA to do this, you can try something like:
Sub DeleteMe(oShp As Shape)
oShp.Delete
End Sub
OR
Sub HideMe(oShp As Shape)
oShp.Visible = msoFalse
End Sub
OR
Sub MoveMe(oShp As Shape)
oShp.Top = 3000
End Sub
The first procedure will delete the shape. This is unlikely to be what you
want because the shape will be gone, messing up your presentation. The
second procedure simply hides the shape. This tends to work well because the
shape is just where you left it, but it is hidden. However, I have found
that hiding shapes is not always as reliable as it should be in 2007. Also,
you will need something to make the shapes visible again once they are
hidden. The easiest thing is the ShowItAll procedure on my Web Site
(
http://www.PowerfulPowerPoint.com/) under More Tricks. Finally, if deleting
is no good for you and hiding isn't working properly, you can move the shape
as in the third procedure. This will require some way to put the shape back
where it belongs when the PowerPoint starts. This is doable, but you have to
know where every shape belongs (possibly adding some more code to keep track
of that).
--David
--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland