CanvasShapes.AddShape (Word)

Adds an AutoShape to a drawing canvas. Returns a Shape object that represents the AutoShape.

To change the type of an AutoShape that you've added, set the AutoShapeType property.

AddShape (Type, Left, Top, Width, Height)


Sub NewCanvasShape() 
 Dim shpCanvas As Shape 
 Dim shpCanvasShape As Shape 
 
 'Add a new drawing canvas to the active document 
 Set shpCanvas = ActiveDocument.Shapes.AddCanvas( _ 
 Left:=100, Top:=75, Width:=150, Height:=200) 
 
 'Add a circle to the drawing canvas 
 Set shpCanvasShape = shpCanvas.CanvasItems.AddShape( _ 
 Type:=msoShapeOval, Left:=25, Top:=25, _ 
 Width:=150, Height:=150) 
End Sub

Arguments

The following arguments are required:

Type (Long) - The type of shape to be returned. Can be any MsoAutoShape constant.

Left (Single) - The position, measured in points, of the left edge of the AutoShape.

Top (Single) - The position, measured in points, of the top edge of the AutoShape.

Width (Single) - The width, measured in points, of the AutoShape.

Height (Single) - The height, measured in points, of the AutoShape.