PowerPoint 2002 multiple masters automation

P

Praded

I have the Powrpoint Template file and trying to apply it to the
presentation using automation. That template has multiple masters. I do
the following:

[C#]
PowerPoint.Application powerPointApp = null;
PowerPoint.Presentation powerPointPresent = null;
PowerPoint.Slide powerPointSlide = null;

powerPointApp = new PowerPoint.ApplicationClass();
powerPointApp.Visible = MsoTriState.msoTrue;
powerPointApp.ShowStartupDialog = MsoTriState.msoTrue;
powerPointPresent = powerPointApp.Presentations.Add(
MsoTriState.msoTrue );
powerPointPresent.ApplyTemplate( docTemplatePath );
[/C#]

After this code I have only one Design object (first master from
template) in the powerPointPresent.Designs collection.

I've tried to the same action manully in the application:

1. Create new Presentation
2. In the slide design I apply a design template and go the message box
with text: "The design template has multiple masters. PowerPoint has
applied the first master in the template. Do you want to copy the other
masters into your presentation for later use? Yes/No".

If I choose Yes I get all my masters I need. I guess when I do this in
C# code,
Office automation ignores this message and uses default answer "No". So
I get only one slide master.

Is there a way to add allthe slide masters from template by C#? Please
help.

Best regards,
Praded
 
S

Shyam Pillai

Praded,
Copy the designs into the current presentation and then apply the desired
design.
' =====================================================
Dim oSourceDesigns As Presentation
Dim I As Integer
Set oSourceDesigns = Presentations.Open("K:\Templates\main.pot", , , False)
For I = 1 To oSourceDesigns.Designs.Count
ActivePresentation.Designs.Clone oSourceDesigns.Designs(I)
Next I
oSourceDesigns.Close
Set oSourceDesigns = Nothing
'======================================================
Also see: How to apply designs to various slides (2002 and later):
http://www.mvps.org/skp/pptxp007.htm

--
Regards,
Shyam Pillai

Image Importer Wizard
http://skp.mvps.org/iiw.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top