Solved

How to identify a layout placeholder programatically

Posted on 2010-11-16
3
1,127 Views
Last Modified: 2012-05-10
My addin uses templates contained in particular layouts to set up the content of slides. Layouts contain a number of placeholders. My problem is that I don't know how to identify each of these placeholders on a slide to place the required information in them.

So far I have tried the following approaches:

- Naming the placeholders, and using Placeholders.FindByName: Unfortunately placeholders on slides are renamed, they do not maintain the name used in the layout.
- Using tags: Tags placed on placeholders on the layout are not copied over to the placeholders on the slide, so they can't be used to locate them on slides.
- Placing an identification text on the placeholders and looking for it on the slides: The problem is that text entered in the layout is shown in slides (before modifying it), but is not accesible through the TextFrame.TextRange.Text property.

What else can I try?
0
Comment
Question by:momsoft2
  • 2
3 Comments
 
LVL 23

Accepted Solution

by:
JSRWilson earned 100 total points
ID: 34814455
I don't think there;s a good way to do this Placeholders on slides are based on the master but theya re new shapes which is why names tags etc don't match

You could iterate through the placeholders on slide and master (after a reset if necessary) and check Left,Top,Zorder tc and if they match read the name from the master maybe.
0
 

Author Comment

by:momsoft2
ID: 34835441
JSRWilson,

Thank you very much for your answer. I have finally resorted to proceed as you suggest.
0
 

Author Closing Comment

by:momsoft2
ID: 34835468
Unfortunately the solution provided does not solve my original question, but simply provides a workaround. Also, the time ellapsed since I originally asked the question has forced me to find a similar solution by myself.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

People often ask "How do I make this macro run every time I show a new slide or add a new slide etc." This means making PowerPoint respond to that EVENT and, unlike in Excel, it's not that easy! First, I would avoid using the pseudo events left o…
Preface: When I started this series, I used the term CommandBars because that is the Office Object class that it discusses. Unfortunately, when Microsoft introduced Office 2007, they replaced the standard Commandbar menus with "The Ribbon" and rem…
This video teaches viewers how to fit pictures into slides, crop and remove backgrounds, and alter photos to look more professional.
The viewer will learn how to edit animations within the presentation, incorporate sound, and set everything up with timing.

705 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

17 Experts available now in Live!

Get 1:1 Help Now