AutoShape Identification

G

Guest

Is there anyway to identify, from the autoshapes on a slide, which autoshape
corresponds to the .Shapes(nn). property parameter in VBA code? I'm having
to look at some code and it is difficult to tell which shape is being
referred to back on the slide.
 
G

Guest

Hi Bill

Maybe if the code is there you are stuck with .shapes(nn). It's not a
reliable way to do things because the nn refers to the z order on the slide
and this can change if you move shapes forwards or backwards on the slide.
You can use vba to give shapes fixed names or read their default fixed name
and then use .shapes("name")

If you are stuck the way to deduce the nn number is to add select mutiple
objects to a toolbar and then the list order there will give you the z number
(nn) and also the fixed name. (ie first in the list = shapes(1))
http://www.pptalchemy.co.uk/toolbars1.html

Hope that helps feel free to contact me if you need to.

See
 
D

David M. Marcovitz

Are you trying to get the shape's number? You could write a simple macro to
find the number of the selected shape. Another way to do this is by looking
at the number in the Custom Animation. If you are using PowerPoint 2000 or
before, the custom animation dialog box lists the shape number of every
shape on the slide. If you are using 2002 or 2003 (I don't know about 2007,
but I would guess it is the same), custom animation only lists those shapes
that are animated, so you have two choices: (1) animate a shape to find out
its number (and remove the animation once you know), or (2) disable the new
animation features and look at the custom animation dialog box to see all
the shapes on a slide and then turn back on the new animation features.
--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/
 
G

Guest

I know that we've discussed naming being the best way to go before and it
is!! I've often used the custom show method too to deduce slides(nn) but it
failed on me recently.

Try this - add an org chart and then a rectangle to a text & title slide.
Animate the rectangle and look at its "number". Is it really shapes(12)?
 
D

David M. Marcovitz

Interesing. The custom animation number seems to count each member of a
group separately and does not match up with the shape number. So, I guess
my advice applies to slides without groups.

I agree that shape names are best. However, the original poster was
working with existing code and trying to match up shape numbers used in
the code to the actual shapes, so names wouldn't help unless he could go
back in time and get the original coder to use names instead of numbers.

Also, this little VBA routine will cycle through each shape on slide 1
and select a shape and give its number.

Sub TellMeNumbers()
Dim i As Long
For i = 1 To ActivePresentation.Slides(1).Shapes.Count
ActivePresentation.Slides(1).Shapes(i).Select
MsgBox i
Next i
End Sub

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

Guest

Hi David

Sorry not very clear! I meant that the default names were available and
could be substituted using edit>replace. Might or might not be a big job.

That diagram thing really through me and I still don't see how the diagram
is 8 shapes! I suppose it's counting the connectors.
 

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