I'm writing a PowerPoint 2010 AddIn. In a nutshell this is what I do:
- Create PowerPoint Template (*.potx) with a great deal of defined Layout slides
- Write plugin that automates some common tasks that are made after presentation is done. One of them is to insert Agenda Slide (defined as Layout in SlideMaster) as the first slide in every section.
- After the Agenda Slide is inserted (that was pretty easy with:
newAgendaSlide.MoveToSectionStart(sectionNumber)
) I must set the text of two Shape objects (one on the top of the slide, and second one is located in bottom/right corner - let's call the Header & Footer) to the name of current PowerPoint section, on every slide in current section.
And now, I know how to get section's title:
Presentation.SectionProperties.Name(sectionNumber)
and I know how to iterate through Shape
objects that are on the Slide
object. But I don't know how to access right Shape. I can't be sure that, for instance, that my Header/Footer shape will have Id set to particular value? Is there any way to set some kind of property on Layout's Shape, and then be completely sure that the same property will have the same value on the Slide?
To sum up (and hopefully make it clear): I would like to create a Layout slide (in SlideMaster) with x number of shapes, and be able to access particular slide on real presentation slide.