Macro: testing for existence of shape

  • Thread starter Thread starter simonc
  • Start date Start date
S

simonc

I'm writing a macro to take a list of report figure numbers from an Excel
spreadsheet and go through a powerpoint presentation adding the figure number
in a text box on each slide. If the macro has been run previously the text
boxes to hold figure numbers will already exist and in that case I only want
to update the text, not create a new text box. How can I test if the figure
number text box already exists? Can you assign a text box an identification
name? Is there some other way of identifying objects on powerpoint slides?

Grateful for advice
 
You can set the name of a shape:

oShp.Name = "MyName"

There are other ways to do this as well. Just beware that PowerPoint gets
cranky if two shapes on the same slide have the same name, so be sure to
do your checking before assigning a name.

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