Shape names question

  • Thread starter Thread starter Markus
  • Start date Start date
M

Markus

Hi there,

I am currently trying to pimp a presentation with a couple of VBA
scripts.
I am for instance importing png graphics and try to access those
through my scripts.
After playing with the macro recorder I was able to find out the name
of those shapes in order to set
properties or whatever. Slide108.Shapes("Picture 42").Visible =
msoFalse.
Now my question: Is there for mainly readability reasons a way to
change those names?
I could'nt find yet where to change this, but I believe this must be
somewhere possible.

Thanks for any hint, I am using XP SP3 and Office 2003.

best regards,
Markus Steiner
 
Hi there,

I am currently trying to pimp a presentation with a couple of VBA
scripts.
I am for instance importing png graphics and try to access those
through my scripts.
After playing with the macro recorder I was able to find out the name
of those shapes in order to set
properties or whatever. Slide108.Shapes("Picture 42").Visible =
msoFalse.
Now my question: Is there for mainly readability reasons a way to
change those names?
I could'nt find yet where to change this, but I believe this must be
somewhere possible.

Thanks for any hint, I am using XP SP3 and Office 2003.

best regards,
Markus Steiner

Usually I access the shape via
ActivePresentation.Slides(108).Shapes("Picture 42") rather than
Slide108.Shapes...

Regardless of how you access the shape, once you have the shape, just add
..Name="Whatever name you want"

For example,

ActivePresentation.Slides(108).Shapes("Picture 42").Name="Whatever name you
want"

That will change the name to "Whatever name you want" and you will then use
that instead of "Picture 42" (watch out for line breaks in the above code as
the news system will probably put some unwanted ones in).

--David


--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland
 
Usually I access the shape via
ActivePresentation.Slides(108).Shapes("Picture 42") rather than
Slide108.Shapes...

Regardless of how you access the shape, once you have the shape, just add
.Name="Whatever name you want"

For example,

ActivePresentation.Slides(108).Shapes("Picture 42").Name="Whatever name you
want"

That will change the name to "Whatever name you want" and you will then use
that instead of "Picture 42" (watch out for line breaks in the above code as
the news system will probably put some unwanted ones in).

--David

--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland- Zitierten Text ausblenden -

- Zitierten Text anzeigen -

Hi David,

Thanks for your quck response. There is no UI for this somewhere in
PowerPoint (like e.g. the properties dilaog of VB controls)
Isn't it?

Thanks again,
Markus
 
Hi David,

Thanks for your quck response. There is no UI for this somewhere in
PowerPoint (like e.g. the properties dilaog of VB controls)
Isn't it?

Thanks again,
Markus

That's correct. Naming shapes has always been done with VBA.
--David
--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland
 
If you want even easier than David's nice explanation we have a little Add
In to make it so! It's free!

Scroll down to AddIn
http://www.pptalchemy.co.uk/vbanames.html

Select the shape and click the toolbar. It will tell you the current name
and allow you to type in a new one.
John

Markus said:
Hi there,

I am currently trying to pimp a presentation with a couple of VBA
scripts.
I am for instance importing png graphics and try to access those
through my scripts.
After playing with the macro recorder I was able to find out the name
of those shapes in order to set
properties or whatever. Slide108.Shapes("Picture 42").Visible =
msoFalse.
Now my question: Is there for mainly readability reasons a way to
change those names?
I could'nt find yet where to change this, but I believe this must be
somewhere possible.

Thanks for any hint, I am using XP SP3 and Office 2003.

best regards,
Markus Steiner

__________ Information from ESET Smart Security, version of virus
signature database 4767 (20100113) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature database 4767 (20100113) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
If you want even easier than David's nice explanation we have a little Add
In to make it so! It's free!

Scroll down to AddInhttp://www.pptalchemy.co.uk/vbanames.html

Select the shape and click the toolbar. It will tell you the current name
and allow you to type in a new one.
John














__________ Information from ESET Smart Security, version of virus signature database 4767 (20100113) __________

The message was checked by ESET Smart Security.

http://www.eset.com- Zitierten Text ausblenden -

- Zitierten Text anzeigen -

Hi John,

Cool, exactly what I was looking for!
Perfect thanks.

Another one: Is there a way to rename the Microsoft Power Point
Objects like Slide 102, in my case.

Thanks again,
Markus
 
Hi John,

Cool, exactly what I was looking for!
Perfect thanks.

Another one: Is there a way to rename the Microsoft Power Point
Objects like Slide 102, in my case.

Thanks again,
Markus

Well, if you are using the way I mentioned to access slides

ActivePresentation.Slides(102)

then you can substitute a slide name. If you are using Slide102..., then I
don't think you can. The VBA is

ActivePresentation.Slides(102).Name = "Your Name Here"

You can also look at Example 8.7 on my Web site for related code
<http://www.PowerfulPowerPoint.com>

--David

--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland
 
That's correct through PPT 2003.  In 2007 you can rename shapes via theUI.

Our StarterSet Plus add-in includes a kind of object inspector that lets you edit
shape names, add/edit/remove tags, edit links and such on slides, presentations and
shapes.  

http://www.pptools.com/starterset/

The basic starterset is free but doesn't include this feature.

And of course there's John's freebie.

Lotsa Options.

==============================
PPT Frequently Asked Questionshttp://www.pptfaq.com/

PPTools add-ins for PowerPointhttp://www.pptools.com/

PERFECT. That's all I need for now, thanks for all your quick and
efficient help.
BTW: Tried to get the same info on the german group, no answers with
reasonable time....

regards,
Markus
 
Back
Top