Represents a shape object.
For a list of all members of this type, see IShape Members.
NativeExcel.IShape
NativeExcel.IPicture
[Visual Basic] Public Interface IShape [C#] public interface IShape [C++] public __gc __interface IShape [JScript] public interface IShape
Use Shapes[index], where index is the shape's index number (one based), to return a single IShape interface.
The following example sets the width for shape one on worksheet one.
[C#]
book.Worksheets[1].Shapes[1].Width = 90;
The following example demonstrates how to access each shape on worksheet. [C#]
IWorksheet sheet = book.Worksheets[1];
int cnt = sheet.Shapes.Count;
for (int i = 1; i <= cnt; i++)
{
IShape shape = sheet.Shapes[i];
//do something with shape
//.....
}
The following example adds the shape with JPEG picture on worksheet one. [C#]
IWorksheet sheet = book.Worksheets[1];
sheet.Cells[3,3].Select(); //the upper-left corner of the shape
sheet.Shapes.AddPicture("image.jpg");
Use the Delete method to remove shape from a collection. The following example deletes first shape from Shapes collection on sheet one.
[C#]
book.Worksheets[1].Sheets[1].Delete();
Namespace: NativeExcel
Assembly: NativeExcel (in NativeExcel.dll)
IShape Members | NativeExcel Namespace | IComment.Shape Property