[]
Returns a shape range (IShapeRange) object that represents a subset of the shapes in an IShapes collection.
Use this overload to create a shape range by specifying the names of the shapes to include.
IShapeRange this[string[] index] { get; }
ReadOnly Default Property Item(index As String()) As IShapeRange
| Type | Name | Description |
|---|---|---|
| string[] | index | The names of the shapes to include in the returned shape range. |
IShapes shapes = worksheet.Shapes;
IShape rectangle = shapes.AddShape(AutoShapeType.Rectangle, 20, 20, 100, 60);
rectangle.Name = "Rectangle 1";
IShape oval = shapes.AddShape(AutoShapeType.Oval, 140, 20, 100, 60);
oval.Name = "Oval 1";
IShapeRange shapeRange = shapes.Range[new string[] {"Rectangle 1", "Oval 1"}];
Returns a shape range (IShapeRange) object that represents a subset of the shapes in a shapes collection.
Use this overload to create a shape range by specifying the index numbers of the shapes to include.
IShapeRange this[int[] index] { get; }
ReadOnly Default Property Item(index As Integer()) As IShapeRange
| Type | Name | Description |
|---|---|---|
| int[] | index | The index numbers of the shapes to include in the returned shape range. |
IShapes shapes = worksheet.Shapes;
shapes.AddShape(AutoShapeType.Rectangle, 20, 20, 100, 60);
shapes.AddShape(AutoShapeType.Oval, 140, 20, 100, 60);
IShapeRange shapeRange = shapes.Range[new int[] { 0, 1 }];