共用方式為


Shapes.AddShape Method

Creates an AutoShape. Returns a Shape object that represents the new AutoShape.

Namespace:  Microsoft.Office.Interop.PowerPoint
Assembly:  Microsoft.Office.Interop.PowerPoint (in Microsoft.Office.Interop.PowerPoint.dll)

Syntax

'Declaration
Function AddShape ( _
    Type As MsoAutoShapeType, _
    Left As Single, _
    Top As Single, _
    Width As Single, _
    Height As Single _
) As Shape
'Usage
Dim instance As Shapes
Dim Type As MsoAutoShapeType
Dim Left As Single
Dim Top As Single
Dim Width As Single
Dim Height As Single
Dim returnValue As Shape

returnValue = instance.AddShape(Type, _
    Left, Top, Width, Height)
Shape AddShape(
    MsoAutoShapeType Type,
    float Left,
    float Top,
    float Width,
    float Height
)

Parameters

  • Left
    Type: System.Single
    The position, measured in points, of the left edge of the AutoShape relative to the left edge of the slide.
  • Top
    Type: System.Single
    The position, measured in points, of the top edge of the AutoShape relative to the top edge of the slide.
  • Width
    Type: System.Single
    The width of the AutoShape, measured in points.
  • Height
    Type: System.Single
    The height of the AutoShape, measured in points.

Return Value

Type: Microsoft.Office.Interop.PowerPoint.Shape

Remarks

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

See Also

Reference

Shapes Interface

Shapes Members

Microsoft.Office.Interop.PowerPoint Namespace