Class Selection (PowerPoint VBA)

The class Selection represents the selection in the specified document window. The Selection object is deleted whenever you change slides in an active slide view (the Type property will return ppSelectionNone).

Class DocumentWindow gives access to class Selection.

To use a Selection class variable it first needs to be instantiated, for example

Dim slc as Selection
Set slc = ActiveWindow.Selection

Selection class variables can be set using the DocumentWindow.Selection procedure.

Methods

Copy - Copies the specified object to the Clipboard.

Cut - Deletes the specified object and places it on the Clipboard.

Delete - Deletes the specified Selection object.

Unselect - Cancels the current selection.

Properties

ChildShapeRange returns a ShapeRange object that represents the child shapes of a selection.

HasChildShapeRange true if the selection contains child shapes.

ShapeRange returns a ShapeRange object that represents all the slide objects that have been selected on the specified slide.

SlideRange returns a SlideRange object that represents a range of selected slides.

TextRange returns a TextRange object that represents the selected text.

TextRange2 returns the TextRange2 object of the current Selection object.

Type represents the type of objects in a selection.

ShapeRange - Represents a shape range, which is a set of shapes on a document. A shape range can contain as few as a single shape or as many as all the shapes on the document.

SlideRange - A collection that represents a notes page or a slide range, which is a set of slides that can contain as little as a single slide or as much as all the slides in a presentation.

TextRange - Contains the text that's attached to a shape, and properties and methods for manipulating the text.