NamedSlideShow Interface

A collection of all the NamedSlideShow objects in the specified presentation.

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

Syntax

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

Remarks

The following examples describe how to:

  • Create a slide and add it to the collection

  • Return a single slide that you specify by name, index number, or slide ID number

  • Return a subset of the slides in the presentation

  • Apply a property or method to all the slides in the presentation at the same time

Examples

Use the SlideShowWindows property to return a Slides collection. Use the Add(MsoTriState) method to create a new slide and add it to the collection. The following example adds a new slide to the active presentation.

ActivePresentation.Slides.Add 2, ppLayoutBlank

Use Slides(index), where index is the slide name or index number, or use the Slides.FindBySlideID(index), where index is the slide ID number, to return a single Slide object. The following example sets the layout for slide one in the active presentation.

ActivePresentation.Slides(1).Layout = ppLayoutTitle

The following example sets the layout for the slide named "Big Chart" in the active presentation. Note that slides are assigned automatically generated names of the form Sliden (where n is an integer) when they're created. To assign a more meaningful name to a slide, use the Name property.

ActivePresentation.Slides("Big Chart").Layout = ppLayoutTitle

Use Slides.Range(index), where index is the slide index number or name or an array of slide index numbers or an array of slide names, to return a SlideRange object that represents a subset of the Slides collection. The following example sets the background fill for slides one and three in the active presentation.

With ActivePresentation.Slides.Range(Array(1, 3))

    .FollowMasterBackground = False

    .Background.Fill.PresetGradient msoGradientHorizontal, _

        1, msoGradientLateSunset

End With

If you want to do something to all the slides in your presentation at the same time (such as delete all of them or set a property for all of them), use Slides.Range with no argument to construct a SlideRange collection that contains all the slides in the Slides collection, and then apply the appropriate property or method to the SlideRange collection. The following example sets the background fill for all the slides in the active presentation

With ActivePresentation.Slides.Range

    .FollowMasterBackground = False

    .Background.Fill.PresetGradient msoGradientHorizontal, _

        1, msoGradientLateSunset

End With

See Also

Reference

NamedSlideShow Members

Microsoft.Office.Interop.PowerPoint Namespace