locked
Adding new slide into powerpoint using c# RRS feed

  • Question

  • Hi,

    I want to add new slide in powerpoint with the specified layout. However, the new slide was added as blank layout even if I choose other layout. I am using the following code.

    using PPT = Microsoft.Office.Interop.PowerPoint;
    
    public sub AddNewSlide()
    {
    PPT.CustomLayout customLayout = null;
    PPT.Slide activeSlide = null;
    
    customLayout = Globals.ThisAddIn.Application.ActivePresentation.SlideMaster.CustomLayouts[3];
    activeSlide = Globals.ThisAddIn.Application.ActivePresentation.Slides.AddSlide(1,customLayout);
    }
    
    
    Iam using Powerpoint 2010 and Visual Studio 2010. The same code is working in my colleague machine. Do I need to install any patches. Kindly help.

    Thursday, September 19, 2013 6:32 AM

Answers

  • Hi,

    You said the CustomLayouts property of the SlideMaster doesn't work for your PowerPoint.

    Have you ever try to set the Custom Layout of the Slide master manually?

    I suggest you to check whether this Layout exists in your PowerPoint and make sure you can set it manually.

    If the Layout doesn't exist, you could create a custom layout as you like.

    Thursday, September 26, 2013 2:59 AM