Failed to get background of a slide

Discussion in 'Microsoft Certification' started by =?Utf-8?B?YXJjaGFuYXNy?=, Aug 17, 2007.

  1. 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
    =?Utf-8?B?YXJjaGFuYXNy?=, Aug 17, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anastasio A Rossi

    In OE, background music and pictures get lost when sent

    Anastasio A Rossi, Feb 6, 2004, in forum: Computer Support
    Replies:
    11
    Views:
    708
    michael turner
    Feb 7, 2004
  2. Patrick
    Replies:
    0
    Views:
    447
    Patrick
    Feb 7, 2004
  3. Joe Boon

    Background printing failed

    Joe Boon, Feb 21, 2004, in forum: Computer Support
    Replies:
    5
    Views:
    608
    Misa Mirkovic
    Feb 21, 2004
  4. LAshooter
    Replies:
    0
    Views:
    433
    LAshooter
    Jun 25, 2005
  5. rex
    Replies:
    2
    Views:
    481
Loading...

Share This Page