ShapeCollection.AddShape

ShapeCollection.AddShape method

Adds a Shape to the worksheet.

public Shape AddShape(MsoDrawingType type, int upperLeftRow, int top, int upperLeftColumn, 
    int left, int height, int width)
ParameterTypeDescription
typeMsoDrawingTypeMso drawing type.
upperLeftRowInt32Upper left row index.
topInt32Represents the vertical offset of Shape from its left row, in unit of pixel.
upperLeftColumnInt32Upper left column index.
leftInt32Represents the horizontal offset of Shape from its left column, in unit of pixel.
heightInt32Represents the height of Shape, in unit of pixel.
widthInt32Represents the width of Shape, in unit of pixel.

Return Value

A Shape object.

Remarks

The type could not be Chart/Comment/Picture/OleObject/Polygon/DialogBox

Examples


[C#]
//Add a shape of the specified type
Shape shapeByType = shapes.AddShape(MsoDrawingType.CellsDrawing, 1, 0, 1, 0, 100, 50);

See Also