Use the
Shapes property to return the TXLSShapes collection.
The following example sets the
width for
shape one on Worksheet one.
Workbook.Sheets[1].Shapes[1].Width := 90;
The following example demonstrates how to access each
shape on Worksheet.
Var
Shape: TXLSShape;
cnt, i: Integer;
begin
With Workbook.Sheets[1] do begin
cnt := Shapes.Count;
for i := 1 to cnt do begin
Shape := Shapes[i];
//do something with Shape
//......
end;
end;
end;
The following example adds the
shape with JPEG picture on Worksheet one.
With Workbook.Sheets[1] do begin
Cells[3, 3].Select; //the upper-left corner of the shape
Shapes.AddPicture('image.jpg');
end;
Use the Delete method to remove
shape from a
Sheets collection.
The following example deletes first
shape from
Shapes collection on sheet one.
Workbook.Sheets[1].Shapes[1].Delete;