Renaming Shapes in PowerPoint

G

Guest

Hi All,
Currently I'm dipping my toes into VB in PowerPoint.
When dealing with scripts in VB it refers to the shapes in the presentation
in the order they were created, ie case 5 or rectangle 1 etc. This can be a
little confusing to work out which shape the script is referring to. Is there
a way of assigning a name to a shape so that it can be more easily identified
within the script similar to the way you ca rename a master slide. I have
found that if you assign an animation to a shape that this will display the
number of the shape in the Custom Animation menu. While this works, it's a
little 'long winded'. I was hoping there might be a simple way of assigning
to a shape and be able to view it easily.
Thanks
Chris
 
G

Guest

Thanks Bill,

Found the addin and installed it into PowerPoint.
Whilst I can rename a shape using the new toolbar, the new name doesn't
carry through to the VB script page or to the 'Custom Animation' dialogue box
on the right hand side of the screen layout. Do you know if there is any way
to get the new names to be recognised by other parts of PowerPoint? For
example I renamed a shape to be 'Metro'. This shape still showed up as 'Case
1' in the VB area and as 'Rounded Rectangle 1' in the 'Custom Animation'
dialogue box. Before the shape was renamed, it appeared as 'Autoshape 15' in
the renaming toolbar, which is a different label again.
Thanks again for your assistance.
Chris
 
S

Steve Rindsberg

Thanks Bill,

Found the addin and installed it into PowerPoint.
Whilst I can rename a shape using the new toolbar, the new name doesn't
carry through to the VB script page or to the 'Custom Animation' dialogue box
on the right hand side of the screen layout. Do you know if there is any way
to get the new names to be recognised by other parts of PowerPoint? For
example I renamed a shape to be 'Metro'. This shape still showed up as 'Case
1' in the VB area and as 'Rounded Rectangle 1' in the 'Custom Animation'
dialogue box.

To some extent, this is known behavior. PowerPoint assigns shapes internal names
when it creates them. You can't change that name. Each shape also has a .Name
property, which you *can* change. Unfortunately, it displays the internal name
rather than the .Name property in the Cussed Animation dialog box.

I don't understand what you mean when mention the name that shows up in the VB area?
Where do you see this?

In any case, once you've renamed a shape, you can access through VBA by using
.Shapes("your shape name") rather than .Shapes(nn) where nn is the index
 
G

Guest

OK this is where I have got to.

Thanks to your suggestions about checking the shape identifier numbers on
the master slide, as they are most likely different to what they are/were on
the presentation slide, I have been able to make the mouseover action work on
buttons placed on the master slide, except... For some reason the mouseover
action will only return a result in a shape on a presentation slide and not a
master slide.
For example, if I start with a new blank presentation and draw 6 mouseover
buttons/shapes and one result textbox/shape and insert the following code:

Sub DisplayMessage(oShp As Shape)
' ascertain the position of the mouse by checking the
' index value of shape over which the mouse rests.
With SlideShowWindows(1).View.Slide _
.Shapes(7).TextFrame.TextRange
Select Case oShp.ZOrderPosition
' The purple rectangle on which the buttons rest
' we use the event here to clear the existing message while
' the mouse moves to the next shape

Case 1
.Text = "Metro"
Case 2
.Text = "Projects"
Case 3
.Text = "Process"
Case 4
.Text = "Finishes"
Case 5
.Text = "Technical"
Case 6
.Text = "Misc"


End Select
DoEvents
End With
End Sub

Mousing over any of the button/shapes/case in 'Show' mode will return the
appropriate text in the text/rectangle/shape 7.

If I copy all the shapes to the master page, assuming it is completely
empty, and position the shapes at a different place on the slide, the pasted
shapes on the master slide have exactly the same identifier numbers as the
corresponding shapes on the presentation slide. So all of the VB script is
still applicable.

When I go to 'Show' mode, if I mouse over the buttons/shapes that were
placed on the presentation slide, they return a result in the
text/rectangle/shape 7 sitting on the presentation slide. If I mouseover the
buttons/shapes that were placed on the master slide they will also return a
result, however the result is returned in the text/rectangle/shape7 that is
sitting on the presentation slide and not the text/rectangle/shape7 that is
sitting on the master page. Even if I create a shape 8 on the master slide
and change the VB script to suit, I still can't get a result showing up in a
text/rectangle shape sitting on the master slide.

Frustrating, as I need all these buttons on master slides as my project
requires around 100 slides between several linked presentations. So you can
see I'm trying to keep things simple and a smaller file size by trying to
work with the master page for the buttons.

Looking at the VB script again, I'm wondering if the key lies in the lines:
With SlideShowWindows(1).View.Slide _
.Shapes(7).TextFrame.TextRange

Are the words 'With SlideShowWindows(1).View.Slide _' telling PowerPoint to
look at the presentation slide to return the result in shape 7 rather than
returning the result in shape 7 on the master page. If this is the case, is
there an alternate script to tell PowerPoint to look at the master page for
shape 7 in which to display the result.

I have also tried adding another VB module for the shapes on the master
slide but PowerPoint only wants to return a result in shape 7 on the
presentation slide.

Again I really appreciate your help and this eventual solution will be used
in all my followup presentations.

Regards

Chris
 
D

David M. Marcovitz

Do you now have shapes on both the master slide and the slide itself? If
so, the shapes on the slide itself will be on top. This means that
whatever is on the master is covered up by the shapes on the slide itself
so the shape that gets the mouse over is the one on the slide. Try
getting rid of the shapes on the slide itself and see if it works.
--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/
 
S

Steve Rindsberg

OK this is where I have got to.

In this thread AND the other. Naughty Chris. [whackwhack with rolled up newspaper]

;-)

See my reply in the other thread, 'kay?
 
G

Guest

Hi Steve,
My Apologies.
The two threads, that were related but different eventually merged to the
same topic.
Thanks for all your assistance.
I'll close this now and revert to the other thread.Regards
Chris

Steve Rindsberg said:
OK this is where I have got to.

In this thread AND the other. Naughty Chris. [whackwhack with rolled up newspaper]

;-)

See my reply in the other thread, 'kay?
 
S

Steve Rindsberg

Hi Steve,
My Apologies.
The two threads, that were related but different eventually merged to the
same topic.
Thanks for all your assistance.
I'll close this now and revert to the other thread.

Deal. ;-)
 

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

Similar Threads


Top