sip007
sip007

Reputation: 1

Inserting Summary Zoom Slide into PowerPoint Presentation 2016

Sub insert_zoom()
    Dim pTargetSlide As slide, pNewSlide As slide _
        , pLayout As CustomLayout _
        , pShape As shape _
        , i As Integer

    With Application.ActivePresentation
        Set pLayout = .Slides(1).CustomLayout
        Set pTargetSlide = Application.ActiveWindow.View.slide
        Set pNewSlide = .Slides.AddSlide(.Slides.Count + 1, pLayout)
    End With

    With pNewSlide
        .Select
        .Shapes.Paste
        .SlideShowTransition.Hidden = msoTrue
    End With

    pTargetSlide.Select
    Application.CommandBars.ExecuteMso "SlideZoomInsert"
    
    For i = 1 To pNewSlide.SlideNumber - 1
        SendKeys ("{RIGHT}")
    Next i
    SendKeys (" ~")

 
 End Sub

Getting error in code line : Application.CommandBars.ExecuteMso "SlideZoomInsert"

error ref:

error in code:

I have already added all sections to the slide, just need a code to insert summary slide.

Added Sections in slides

need a VBA code to insert Summary slide: in the below manner:

final output image slide

I have tried this code:

Sub insert_zoom()
    Dim pTargetSlide As slide, pNewSlide As slide _
        , pLayout As CustomLayout _
        , pShape As shape _
        , i As Integer

    With Application.ActivePresentation
        Set pLayout = .Slides(1).CustomLayout
        Set pTargetSlide = Application.ActiveWindow.View.slide
        Set pNewSlide = .Slides.AddSlide(.Slides.Count + 1, pLayout)
    End With

    With pNewSlide
        .Select
        .Shapes.Paste
        .SlideShowTransition.Hidden = msoTrue
    End With

    pTargetSlide.Select
    Application.CommandBars.ExecuteMso "SlideZoomInsert"
    Application.CommandBars.GetEnabledMso True
    Application.CommandBars.ExecuteMso 1

    For i = 1 To pNewSlide.SlideNumber - 1
        SendKeys ("{RIGHT}")
    Next i
    SendKeys (" ~")

 
 End Sub

I am trying to insert summary slide based on sections.

Upvotes: 0

Views: 106

Answers (0)

Related Questions