Shapes.Range Method
Publisher Developer Reference |
Returns a ShapeRange object that represents a subset of the shapes in a Shapes collection.
Syntax
expression.Range(Index)
expression A variable that represents a Shapes object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
Index | Required | Variant | 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 Index is omitted, the Range method returns all the objects in the specified collection. |
Return Value
ShapeRange
Example
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.
Visual Basic for Applications |
---|
|
This example sets the fill pattern for shapes one and three on the active publication.
Visual Basic for Applications |
---|
|
Visual Basic for Applications |
---|
|
This example sets the fill pattern for the shapes named "Oval 4" and "Rectangle 5" on the first page.
Visual Basic for Applications |
---|
|
This example sets the fill pattern for all shapes on the first page.
Visual Basic for Applications |
---|
|
This example sets the fill pattern for shape one on the first page.
Visual Basic for Applications |
---|
|
This example creates an array that contains all the AutoShapes on the first page, uses that array to define a shape range, and then distributes all the shapes in that range horizontally.
Visual Basic for Applications |
---|
|
See Also