Solved

How to identify a layout placeholder programatically

Posted on 2010-11-16
3
1,131 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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Background   Certain code in VBA requires initialization, such as application events. The app initialization is often triggered by the Auto_Open sub which is a special procedure that runs when an add-in loads. More significantly, this sub does n…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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 edit the master slide. They will also learn how to combine multiple themes into one master slide to use them in their presentation.

773 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