RemoveShape Method

Removes a shape with the specified index from the shape collection of the group/page, and returns the number of remaining shapes.

Applies to: Page object, Shape object

Syntax

[[Let] countRet =] object.RemoveShape ( index )

The RemoveShape method syntax has these parts:

Part Description
object Required. An expression that returns an object in the Applies to list.
index Required. An expression that returns a Long value. The index of the shape in the shape collection of the group/page.
countRet Optional. A Long type variable.

Remarks

If index is less than 1, or greater than the number of shapes in the group/page, the RemoveShape method doesn't remove anything and returns the current number of shapes in the group/page. When a shape is removed, the remaining shapes are re-indexed - that is, the index of every shape after the removed one is decreased by 1. To find out the number of shapes in the group/page, use the ShapesNum method.

 

See Also

RemoveAllShapes method, RemoveShapeByID method, ReorderShape method, ReorderShapeByID method, Shape method, ShapeByID method, ShapesNum method