NamedSlideShow.SlideIDs property (PowerPoint)

Returns an array of slide IDs for the specified named slide show. Read-only.

Syntax

expression. SlideIDs

expression A variable that represents a NamedSlideShow object.

Return value

Variant

Example

This example adds the current slide in the active window to the custom slide show named "Marketing Short Version." Note that to save a modified version of the custom slide show, you must delete the original custom show and then add it again, using the same name. Also note that if you want to resize an array contained in a Variant variable, you must explicitly declare the variable before attempting to resize its array.

'NOTE - The following code line is NOT optional.
'Can't redim array without this
Dim customShowSlideIDs As Variant
Dim customShowToExpand As NamedSlideShow

customShowName = "Marketing Short Version"

Set customShowToExpand = ActivePresentation.SlideShowSettings _
    .NamedSlideShows(customShowName)

slideToAddID = ActiveWindow.View.Slide.SlideID
customShowSlideIDs = customShowToExpand.SlideIDs
numSlides = UBound(customShowSlideIDs)

ReDim Preserve customShowSlideIDs(numSlides + 1)

customShowSlideIDs(numSlides + 1) = slideToAddID
customShowToExpand.Delete
ActivePresentation.SlideShowSettings.NamedSlideShows _
    .Add customShowName, customShowSlideIDs

See also

NamedSlideShow Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.