Add Method (NamedSlideShows Collection Object)

Applies To

NamedSlideShows collection object.

Description

Creates a new named slide show and adds it to the collection of named slide shows in the specified presentation. Returns a NamedSlideShow object that represents the new named slide show.

Syntax

expression.Add(Name, SafeArrayOfSlideIDs)

expression Required. An expression that returns a NamedSlideShows object.

Name Required String. The name of the slide show.

SafeArrayOfSlideIDs Required Variant. Contains the unique slide IDs of the slides to be displayed in a slide show.

Remarks

The name you specify when you add a named slide show is the name you use as an argument to the Run method to run the named slide show.

Example

This example adds to the active presentation a named slide show "Quick Show" that contains slides 2, 7, and 9. The example then runs this slide show.

Dim qSlides(1 To 3) As Long
With ActivePresentation
    With .Slides
        qSlides(1) = .Item(2).SlideID
        qSlides(2) = .Item(7).SlideID
        qSlides(3) = .Item(9).SlideID
    End With
    With .SlideShowSettings
        .NamedSlideShows.Add "Quick Show", qSlides
        .RangeType = ppShowNamedSlideShow
        .SlideShowName = "Quick Show"
        .Run
    End With
End With