none
Formating lost while programmatically pasting slides from multiple presentations into a single presentation using C# Interop RRS feed

  • Question

  • Hi 
    I am trying to paste multiple slides from a different PPTs  in an existing PPT.
    I could paste multiple slides but issue is formating of slides is not preserved.
    my code is as follows

    Presentation pres = pptApp.Presentations.Open("Original.pptx", MsoTriState.msoFalse, MsoTriState.msoFalse, MsoTriState.msoFalse);
                        int counter = 1;
    //slideNumbers is a list of slide numbers or position at which we are going to insert the slide in original file
                        foreach (var number in slideNumbers)
                        {
                            if (pres != null)
                            {                                                       
                                pres.Slides[number].Delete();
                                pres.Slides.InsertFromFile("temp.pptx", number- 1, counter, counter);                         
                                counter++;                        
                            }
                        }
                                      }
                    if (pres != null)
                    {
                        pres.SaveAs("Final.pptx");
                        pres.Close();
                        Marshal.ReleaseComObject(pres);
                    }

     I need solution in c#.
    Thank you !
    Wednesday, September 14, 2016 4:26 AM

All replies