Changed shape names don't stick

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've tried a whole bunch of different macros now that I found on the web that
are supposed to change object names. And it worked for 2 text boxes, but I
haven't been able to get any other names to stick. They do show as having
been changed cos when I click off the object then click on it again and try
to rename it, it shows the changed name. Then I save the file and reopen,
and the old names have all come back.

I need to name a variety of things over 50 slides; mostly text boxes and
charts. It would be highly frustrating if I had to remember each as Object
43 etc etc. in my VBA coding. Any idea why this might be happening?

I am using Powerpoint 2003, Win XP.

Thanks a lot!
 
Probably you are naming shapes with the same name on the same slide.
That's a no-no bug.

As a suggested alternative to using shape names, Steve Rindsberg and I
would likely recommend using tags on the shapes. There's an excellent
set of articles on the PPTFAQ,com site. Either search the PPTFAQ on
"tags" or start here
http://www.pptfaq.com/FAQ00815.htm

Brian Reilly, MVP
 
No, actually all my items have a very specific name. E.g. chartFaculty,
chartStudents, tblFaculty, tblStudents and so on. There aren't even
repeating names over different slides. Also, it allows me to change the name
and keeps it within the session. Except the moment I exit and reopen the
file, all my changes have been lost. It would seem to me that if I were
naming two different objects with the same name on the same slide, that the
initial renaming wouldn't even go through - right?

I will read up on tags in the meantime, but it would be great to figure out
why PPT won't let me keep a changed name.

Thanks for the pointer on tags for the time being.
Lynette
 
Lynette,
Rindsberg and I loved the ShapeNames concept when it came out. But
only for a little while. Works just fine in small presentations. Bit
us, certainly me, as things got more complex.

Tags is it, Tag, you are it. Steve has tested way more tags than you
would ever want to contemplate and they all work just great.

Let us know if you need more help. Rindsberg and I are sort of a
Tag-Team wrestling team. Usually we wrestle the shapes and tags,
sometimes we are even known to wrestle each other (vbg).

Brian Reilly, MVP
 
No, actually all my items have a very specific name. E.g. chartFaculty,
chartStudents, tblFaculty, tblStudents and so on. There aren't even
repeating names over different slides. Also, it allows me to change the name
and keeps it within the session. Except the moment I exit and reopen the
file, all my changes have been lost. It would seem to me that if I were
naming two different objects with the same name on the same slide, that the
initial renaming wouldn't even go through - right?

That's correct. In some cases, though, PPT will itself create multiple shapes with
the same name on one slide, and when it does, it may not allow you to rename either
of the shapes.

Sometimes duplicating the shape and deleting the original will allow you to rename
the shape.

It might be some other form of corruption causing the problem. Try "roundtripping"
the pressie to HTML and back:

HTML "Round-tripping" to repair corruption
http://www.pptfaq.com/FAQ00526.htm

If still no joy, post your renaming code here for us to have a look at.

Overall, though, I'd go with Brian's suggestion. Use tags. Write yourself a
little function along the following lines:

Function ShapeNamed(strTagName as String, _
strTagValue as String, _
oSld as Object) as Shape
' Object rather than Slide so we can pass it slide masters too

Dim oSh as Shape
For Each oSh in oSld.Shapes
If oSh.Tags(strTagName) = strTagValue Then
' Found it!
Set ShapeNamed = oSh
Exit Function
End If
Next
End Function

Then you can do something like:

Dim oSh as Shape

Set oSh = ShapeNamed("ShapeNameTag", "Bob", ActivePresentation.Slides(1))
If not oSh Is Nothing Then
' Do yer stuff
End If
 
Let us know if you need more help. Rindsberg and I are sort of a
Tag-Team wrestling team. Usually we wrestle the shapes and tags,
sometimes we are even known to wrestle each other (vbg).


That reminds me, it's my treat this week.

Jello or mud?
 
Oh NO,
Steve agrees with me on something! What is this world coming to.
(vbg)

Brian Reilly, MVP
 
Try the following:
1. Save the presentation as HTML.
2. Restart PowerPoint.
3. Re-Open the HTML presentation.
4. Now save it as a PPT.

Try giving shape name again and save the presentation.

--
Regards,
Shyam Pillai

Image Importer Wizard
http://skp.mvps.org/iiw.htm
 
Back
Top