PowerPoint Automation Question

  • Thread starter Thread starter Bob Flenniken
  • Start date Start date
B

Bob Flenniken

I am using Access to create PowerPoint presentations
through automation. The only area I'm having a problem
with is applying a template to a specific slide. It
applies to the slide alright, but also to every slide
after that. What do I have to do to keep the template from
being applied to the remaining slides in the presentation?
 
I AM USING PowerPoint 2002. So how can I do it in code?
Using the ApplyTemplate method with both the presentation
and slide objects produces the same result: the template
is applied to the entire set of remaining slides.
 
I'll take a shot at this but it is some what guess work and what I have seen
through my testing. A master in 2002 is applied to a specific slide. That
master is in effect for all subsequent slides until another master is found.
I assume you build the presentation through automation by adding slides. As
you apply a template that becomes the effective template for subsequently
added slides. If you insert a slide earlier in the presentation I do not
know which template applies to that slide and what effect it has on all
subsequent slides.

Check here for some more info on multiple masters.
http://www.echosvoice.com/multipletemplates.htm
 
Thanks. That is what I am doing and what is happening - I
add slides sequentially. I just developed a workaround. I
created a plain presentation and saved it as a template
named "Default". When I create a slide, if the overall
presentation does not have a template applied and the
individual slide does not either, I apply the Default
template I created. So every slide has a template applied
one way or another. This works the way I need it to.
 
After reading all your comments again, I changed the code
so it has a presentation phase and a slide phase with two
passes through the slides. The presentation phase applies
a template to the entire presentation if it is specified.
For the slides, pass 1 creates the slides. Pass 2 applies
the templates to each slide as appropriate. Doing it this
way, only the slide to which the template is applied is
changed. All others remain as they were. Perfect!!!

The key is to apply templates after the slides are ALL
created. Thanks a lot.
 
Back
Top