GroupShapes.Range Method
Returns a ShapeRange object.
Namespace: Microsoft.Office.Interop.PowerPoint
Assembly: Microsoft.Office.Interop.PowerPoint (in Microsoft.Office.Interop.PowerPoint.dll)
Syntax
'Declaration
Function Range ( _
Index As Object _
) As ShapeRange
'Usage
Dim instance As GroupShapes
Dim Index As Object
Dim returnValue As ShapeRange
returnValue = instance.Range(Index)
ShapeRange Range(
Object Index
)
Parameters
- Index
Type: System.Object
The individual shapes that are to be included in the range. Can be an Integer that specifies the index number of the shape, a String that specifies the name of the shape, or an array that contains either integers or strings. If this argument is omitted, the Range method returns all the objects in the specified collection.
Return Value
Type: Microsoft.Office.Interop.PowerPoint.ShapeRange
ShapeRange
Remarks
Although you can use the Range method to return any number of shapes or slides, it is simpler to use the [F:Microsoft.Office.Interop.PowerPoint.GroupShapes.Range(System.Object).ppmthItem1_HV05192896.htm#Item#SameCHM] method if you only want to return a single member of the collection. For example, Shapes(1) is simpler than Shapes.Range(1), and Slides(2) is simpler than Slides.Range(2).
To specify an array of integers or strings for Index, you can use the Array function. For example, the following instruction returns two shapes specified by name.
Dim myArray() As Variant, myRange As Object myArray = Array("Oval 4", "Rectangle 5") Set myRange = ActivePresentation.Slides(1).Shapes.Range(myArray)