Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Latest commit

 

History

History
79 lines (41 loc) · 1.52 KB

application-presentationnewslide-event-powerpoint.md

File metadata and controls

79 lines (41 loc) · 1.52 KB
title keywords f1_keywords ms.prod api_name ms.assetid ms.date
Application.PresentationNewSlide Event (PowerPoint)
vbapp10.chm621008
vbapp10.chm621008
powerpoint
PowerPoint.Application.PresentationNewSlide
e9718cad-6411-d013-6c93-0370aa71a8f2
06/08/2017

Application.PresentationNewSlide Event (PowerPoint)

Occurs when a new slide is created in any open presentation, as the slide is added to the Slides collection.

Syntax

expression. PresentationNewSlide( Sld )

expression An expression that returns a Application object.

Parameters

Name Required/Optional Data Type Description
Sld Required Slide The new slide.

Example

This example modifies the background color for color scheme three and then applies the modified color scheme to the new slide. Next, it adds default text to shape one if it has a text frame.

Private Sub App_PresentationNewSlide(ByVal Sld As Slide)

    With ActivePresentation

        Set CS3 = .ColorSchemes(3)

        CS3.Colors(ppBackground).RGB = RGB(240, 115, 100)

        Windows(1).Selection.SlideRange.ColorScheme = CS3

    End With



    If Sld.Layout <> ppLayoutBlank Then

        With Sld.Shapes(1)

            If .HasTextFrame = msoTrue Then

               .TextFrame.TextRange.Text = "King Salmon"

            End If

        End With

    End If

End Sub

See also

Concepts

Application Object