SlideNumber Property

Microsoft PowerPoint Visual Basic

ShowSlideNumber property as it applies to the HeadersFooters object.

Returns a HeaderFooter object that represents the slide number in the lower-right corner of a slide, or the page number in the lower-right corner of a notes page or a page of a printed handout or outline. Read-only.

expression.SlideNumber

expression    Required. An expression that returns one of the above objects.

ShowSlideNumber property as it applies to the Slide and SlideRange objects.

Returns the slide number. Read-only Integer.

expression.SlideNumber

expression    Required. An expression that returns one of the above objects.

Remarks

The SlideNumber property of a Slide object is the actual number that appears in the lower-right corner of the slide when you display slide numbers. This number is determined by the number of the slide within the presentation (the SlideIndex property value) and the starting slide number for the presentation (the FirstSlideNumber property value). The slide number is always equal to the starting slide number + the slide index number – 1.

Example

ShowAs it applies to the HeadersFooters object.

This example hides the slide number on slide two in the active presentation if the number is currently visible, or it displays the slide number if it's currently hidden.

With Application.ActivePresentation.Slides(2) _
        .HeadersFooters.SlideNumber
    If .Visible Then
        .Visible = False
    Else
        .Visible = True
    End If
End With
				

ShowAs it applies to the Slide and SlideRange objects.

This example shows how changing the first slide number affects the slide number of a specific slide.

With Application.ActivePresentation
    .PageSetup.FirstSlideNumber = 1   'starts slide numbering at 1
    MsgBox .Slides(2).SlideNumber     'returns 2

    .PageSetup.FirstSlideNumber = 10 'starts slide numbering at 10
    MsgBox .Slides(2).SlideNumber     'returns 11
End With