Copy and Pasting Slides problem with different master slides

A

Amrit

Using Powerpoint 2007.

My powerpoint presentation has two Master Slides (A, B). The first Slide is
using Master Slide (A) in the presentation, the rest of the Slides are using
Master Slide (B).

There are 2 scenario's that I need to cater for when copy & pasting or
inserting new slides.

Scenario 1) copy & paste anywhere in the presentation and keep the original
Master Slide layout. I'm able to do this. What was happening before, was if I
added a Slide using Master Slide (B) to position 2 it would adopt Master
Slide (A) from Slide in position 1. This is now fixed using the following
code, please comment on whether or not this would be appropriate:

Globals.ThisAddIn.Application.PresentationNewSlide += (i =>{
CustomLayout layout =
PowerPointLib.GetContentLayoutByName(i.CustomLayout.Name);

if(i.CustomLayout.Preserved.Equals(MsoTriState.msoFalse)){
i.CustomLayout = layout;
}
});

Scenario 2) A Slide using Master Slide (B), is changed and has Placeholders
removed etc. I am able to copy and paste this anywhere in the presentation
keeping the original formatting and removed placeholders, except when adding
the Slide to position 2. The reason for this is that when adding the Slide to
position 2, the Preserved property above is msoFalse, as Powerpoint is trying
to apply Master Slide (A), so I need to set the layout to using Master Slide
(B), but doing so brings back those removed Placeholders.

So if anyone could help with the logic above, this would be much
appreciated. I cannot remove the code as this would break Scenario 1, so what
I'm looking for is some extra logic that can be applied to this.
 

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