Solved

PowerPoint 2003 VBA - shape names

Posted on 2009-05-05
3
1,654 Views
Last Modified: 2012-05-06
Pretty quick and simple...  I have data in an Access database that I'm tyring to DAO out into pre-existing tables in PowerPoint (2003). Formatting adustments may need to be made to the tables also.

Bottom line...PowerPoint shapes (names) are driving me nuts as they seem to change when I alter some part of the table - i.e., in the PPT file, I may have (example) a table called "Group 22".  Fine.  However, say I select a cell or two and apply a fill.  When I go back out and select the whole table and pull the shape name, it's now "Group 23".  ???   Adding a fill to another cell - name is now "Group 24".  Change the border on one of the cells = "Group 33".  Merge a couple cells = "Group 36".

I need these tables to stay fixed so my code can deal with them.  I saw a similar posting on here, but the Experts couldn't reproduce the problem and the user developed a workaround.  I actually worked around this on a previous project by creating the tables from scratch first -which I can't do here as there are 30+ pages of them and the formatting is quite complex.

I have tried assigning names to them in VBA, but still get the name-change issue once I change any part of the table's formatting.  Do PowerPoint objects have any sort of Tag property (like Access controls) that can be referenced instead?

Any other ideas, tips, suggestions and/or answers are greatly appreciated.  Thanks much!
0
Comment
Question by:CThomp2005
3 Comments
 
LVL 59

Assisted Solution

by:Chris Bottomley
Chris Bottomley earned 150 total points
ID: 24306992
They do indeed have a tag, the messiest part is running a process to identify which tags have which names at a given time.  Can you supply an example or is it data sensitive?

For information about an example of linking tags to slides, (in your case of course you want shapes to tags but same idea hopefully) look at http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Powerpoint/Q_24285203.html which whilst it related to slides, the graphics such as I have seen also have a tab associated.

Chris
0
 
LVL 3

Accepted Solution

by:
CThomp2005 earned 0 total points
ID: 24309849
Thanks for the reply, Chris...

As you attest, I have indeed found the Tags property of the Shapes I'm trying to manipulate (I believe under ShapeRange - activewindow.selection.shaperange.tags).  I wrote a little macro to assign the tag names and values to all the tables in my pres, and proceeded to write the rest of the code after that.

I originally coded to reference the tables' shape names, but at some point it stopped working - as I suspected it would - after manipulating the formatting of the tables.  I switched to using a loop on each slide, running through the shapes to find the shape that had the tag value assigned, and then selected it.  After that, was pretty easy.

A royal pain having to run a loop on each slide to find the shape/table you want, instead of being able to reference the shape/table directly.

Thanks much for your confirmation and link...
0
 
LVL 23

Expert Comment

by:JSRWilson
ID: 24848310
You should be able to apply a "fixed" shape name

ActiveWindow.Selection.ShapeRange(1).Name="myname" for example
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been sent a PowerPoint presentation file and wondered why it filled your mailbox? Or have you ever sent a PowerPoint presentation by email and received complaints about the size? Or have you ever created a PowerPoint presentation and t…
Outline From PowerPoint 2010 it is possible to have shapes appear in front of video, in earlier versions video always played in front of other shapes. This means it is possible to have captions animated to appear in front of video. Users who h…
This video teaches viewers how to add transitions to their Slideshows and how to set up timing for the transitions.
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now