Class NamedSlideShows (PowerPoint VBA)

A collection of all the NamedSlideShow objects in the presentation. Each NamedSlideShow object represents a custom slide show. To use a NamedSlideShows class variable it first needs to be instantiated, for example


Dim nsss as NamedSlideShows
Set nsss = ActivePresentation.SlideShowSettings.NamedSlideShows

Add

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.

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.

Add (Name, safeArrayOfSlideIDs)


Dim strName As String: strName = 
Dim lngsafeArrayOfSlideIDs() As Long: lngsafeArrayOfSlideIDs() = 
Dim nss As NamedSlideShow
Set nss = ActivePresentation.SlideShowSettings.NamedSlideShows.Add(Name:=strName, safeArrayOfSlideIDs:=lngsafeArrayOfSlideIDs())

Arguments

The following arguments are required:

Name (String) - The name of the slide show.

safeArrayOfSlideIDs (Long) - Contains the unique slide IDs of the slides to be displayed in a slide show.

Count

Returns the number of objects in the specified collection.


Dim lngCount As Long
lngCount = ActivePresentation.SlideShowSettings.NamedSlideShows.Count

Item

Returns a single NamedSlideShow object from the specified NamedSlideShows collection.

Item (Index)

Index: The name or index number of the single NamedSlideShow object in the collection to be returned.


Dim nss As NamedSlideShow
Set nss = ActivePresentation.SlideShowSettings.NamedSlideShows(Index:=1)