none
excel to powerpoint vba add slide in middle presentation RRS feed

  • Question

  • Hi,

    I have a code that opens a PowerPoint template. Now I want to add slides to the PowerPoint.

    I'm using the code:

    newPowerPoint.ActivePresentation.Slides.Add newPowerPoint.ActivePresentation.Slides.Count + 1, ppLayoutText
        newPowerPoint.ActiveWindow.View.GotoSlide newPowerPoint.ActivePresentation.Slides.Count
        Set activeSlide = newPowerPoint.ActivePresentation.Slides(newPowerPoint.ActivePresentation.Slides.Count)

    The problem is: this code adds a new slide at the end of the presentation, but I want to add one somewhere in the middle of the presentation.

    Does anyone know how to achieve this?

    Thanks!

    Thursday, November 3, 2016 12:23 PM

Answers

  • Hi,

    You can simply add the Number directly where you want to add your slide

    newPowerPoint.ActivePresentation.Slides.Add newPowerPoint.ActivePresentation.Slides.Count + 1, ppLayoutText

    Instead of underlined part, provide the number (3, 4 etc.) where you want to add your slide like at 3rd place or 4th place etc.


    Vish Mishra

    • Marked as answer by ganeshgebhard Thursday, November 3, 2016 12:46 PM
    Thursday, November 3, 2016 12:36 PM