NativeExcel2 for .Net Developer's Reference

IShapes.Item Property

Returns a single IShape interface from a Shapes collection using one-based index number.

[C#] In C#, this property is the indexer for the IShapes class.

[Visual Basic]
DefaultPropertyReadOnlyItem(_
ByValindexAsInteger_
)AsIShape
[C#]
IShapethis[
intindex
]{get;}
[C++]
__propertyIShape*get_Item(
intindex
);
[JScript]
returnValue = IShapesObject.Item( index );
-or-
returnValue = IShapesObject( index );

[JScript] In JScript, you can use the default indexed properties defined by a type, but you cannot explicitly define your own. However, specifying the expando attribute on a class automatically provides a default indexed property whose type is Object and whose index type is String.

Parameters

index
The one-based index number of the IShape interface.

Property Value

IShape interface.

Example

This example deletes first shape from the shape collection on sheet one.

[C#]
IShape shape = book.Worksheets[1].Shapes[1];
if (shape != null) shape.Delete();
[VisualBasic]
Dim shape As IShape = book.Worksheets(1).Shapes(1)
If Not shape Is Nothing Then
   shape.Delete() 
End If
[C++]
IShape* shape = book->Worksheets->Item[1]->Shapes->Item[1];
if (shape != null) shape->Delete();

See Also

IShapes Interface | NativeExcel Namespace