TextRange.InsertSlideNumber method (PowerPoint)

Inserts the slide number of the current slide into the specified text range. Returns a TextRange object that represents the slide number.

Syntax

expression. InsertSlideNumber

expression A variable that represents an TextRange object.

Return value

TextRange

Remarks

The inserted slide number is automatically updated when the slide number of the current slide changes.

Example

This example inserts the slide number of the current slide after the first sentence of the first paragraph in shape two on slide one in the active presentation.

Set sh = Application.ActivePresentation.Slides(1).Shapes(2)

Set sentOne = sh.TextFrame.TextRange.Paragraphs(1).Sentences(1)

sentOne.InsertAfter.InsertSlideNumber

See also

TextRange 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.