Failed to get background of a slide while we insert.

A

archanasr

Hi,
I have tried to insert a slide from one ppt to another ppt using the
function InsertFromFile. But the background of the inserted slide is lost in
the Destination ppt.
How can I apply its background in the Destination ppt.

Since it doesn’t work , I have find out an alternate solution. For each
slide I have created a POT. And then that corresponding POT is applied to the
inserted slide of the Destination ppt. But it works only if the background of
the source ppt is “Applied to all the slidesâ€. If the backround is “Applied
to Selected slides†it doesn’t work.

I have got a PPT ( SOURCEPPT.ppt), having slides with different design
template having different background . For getting the design template of
first slide , i have deleted the other slides of SOURCEPPT.ppt and saved it
as SourceDesign.ppt and SourceDesign.pot. Now the SourceDesign.ppt contains a
slide with template and background of first slide of the SOURCEPPT . I need
that template with its background to be applied to all the slides of that
PPT. I have tried , but its background is lost. How can I apply the
background of one slide to all slides.


Here is the code I have tried:

CString strSourcePPT("D:\\Powerpoint\\SOURCEPPT.ppt");

Presentations presSource( m_ppt->GetPresentations() );
_Presentation SourcePres( presSource.Open( strSourcePPT, FALSE, FALSE, FALSE
) );
Slides SourceSlides( SourcePres.GetSlides() );

int nTotalSlide = SourceSlides.GetCount();
int nDelSlide = nTotalSlide;

for(int nSlideCnt = 1; nSlideCnt < nTotalSlide; ++nSlideCnt)
{
_Slide DeleteSlide( SourceSlides.Item( COleVariant( (long)(nDelSlide) )));
DeleteSlide.Delete();
nDelSlide--;
}

SourcePres.Save();
SourcePres.SaveAs("D:\\Powerpoint\\ SourceDesign.ppt",1,1);
SourcePres.SaveAs("D:\\Powerpoint\\ SourceDesign.pot ",1,1);
SourcePres.Close();

//Applying template to all the slides of SourceDesign.ppt
Presentations presDest( m_ppt->GetPresentations() );
_Presentation DestPres( presDest.Open("D:\\Powerpoint\\ SourceDesign.ppt ",
FALSE, FALSE, FALSE ) );
DestPres.ApplyTemplate(“D:\\Powerpoint\\ SourceDesign.potâ€);
DestPres.Save();
DestPres.Close();



I also tried by creating a PPT with some slides, and manually I loaded the
template “SourceDesign.potâ€. Background of “SourceDesign.pot†is lost while
it is applied to this PPT.

Thanks in Advance

Archana
 

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