PowerPoint Shapes - identifying visible shapes

C

CharlieMcCabe

I've got a presentation with a slide that has 10 shapes on it.

Each time the command button is clicked one of the shapes disappears
until there is only one left.

I want to be able to identify which shape is left i.e."Shape6"

If there some VBA code that can check an activepresentation slide for
shapes and their .visible setting.

If so, I could then use a select case to write up the shape - such as
"your only left with a rectangle".

F.Y.I it's for a kids project.

Thanks for any assistance available
 
C

ciw2otv

I've got a presentation with a slide that has 10 shapes on it.

Each time the command button is clicked one of the shapes disappears
until there is only one left.

I want to be able to identify which shape is left i.e."Shape6"

If there some VBA code that can check an activepresentation slide for
shapes and their .visible setting.

If so, I could then use a select case to write up the shape - such as
"your only left with a rectangle".

F.Y.I it's for a kids project.

Thanks for any assistance available

This link has a code that could be used to identify the shape that is
clicked in the slideshow view.
http://skp.mvps.org/ppt00040.htm#2
Since it passes an arguement you can use Action Setting for each shape
in design mode and run the presentation and it will announce the winner
on each shape clicked with its shape name.
An addin by the same author allows one to rename shapes and slides in
the design mode.
http://skp.mvps.org/downloads/rename.zip
You can read the description at this site.
http://skp.mvps.org/download.htm
There are many helpful VBA code snippets here. You will have to click
many times before you get a message that states "your only left with a
macro"
Hope this helps.
 
D

David M. Marcovitz

I'm not sure exactly what you want, but this code should pop up the name
of any shape that still visible on the current slide. That should get you
started.

Sub WhichShapeIsLeft()
Dim oShp As Shape

For Each oShp In ActivePresentation.SlideShowWindow.View.Slide.Shapes
If oShp.Visible = msoTrue Then
MsgBox oShp.Name & " is left."
End If
Next oShp
End Sub

If you want sensible names, you can go to my site and check out Example
8.7 (under "Examples by Chapter") to get procedures that allow you to set
the names of shapes: http://www.PowerfulPowerPoint.com/

--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/

(e-mail address removed) wrote in @m73g2000cwd.googlegroups.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