Share via


NamedSlideShows Interface

A collection of all the NamedSlideShow objects in the presentation. Each NamedSlideShow object represents a custom slide show.

Namespace:  Microsoft.Office.Interop.PowerPoint
Assembly:  Microsoft.Office.Interop.PowerPoint (in Microsoft.Office.Interop.PowerPoint.dll)

Syntax

'Declaration
<GuidAttribute("9149345B-5A91-11CF-8700-00AA0060263B")> _
Public Interface NamedSlideShows _
    Inherits Collection
'Usage
Dim instance As NamedSlideShows
[GuidAttribute("9149345B-5A91-11CF-8700-00AA0060263B")]
public interface NamedSlideShows : Collection

Examples

Use the _Index(Int32) property to return the NamedSlideShows collection. Use NamedSlideShows(index), where index is the custom slide show name or index number, to return a single NamedSlideShow object. The following example deletes the custom slide show named "Quick Show."

ActivePresentation.SlideShowSettings _

    .NamedSlideShows("Quick Show").Delete

Use the Add(String, Object) method to create a new slide show and add it to the NamedSlideShows collection. The following example adds to the active presentation the named slide show "Quick Show" that contains slides 2, 7, and 9. The example then runs this custom 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

See Also

Reference

NamedSlideShows Members

Microsoft.Office.Interop.PowerPoint Namespace