Share via


CanvasShapes.AddCurve Method

Creates a Bézier curve. Returns a CanvasShapes object that represents the new curve.

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

Syntax

'Declaration
Function AddCurve ( _
    SafeArrayOfPoints As Object _
) As Shape
'Usage
Dim instance As CanvasShapes
Dim SafeArrayOfPoints As Object
Dim returnValue As Shape

returnValue = instance.AddCurve(SafeArrayOfPoints)
Shape AddCurve(
    Object SafeArrayOfPoints
)

Parameters

  • SafeArrayOfPoints
    Type: System.Object
    An array of coordinate pairs that specifies the vertices and control points of the curve. The first point you specify is the starting vertex, and the next two points are control points for the first Bézier segment. Then, for each additional segment of the curve, you specify a vertex and two control points. The last point you specify is the ending vertex for the curve. Note that you must always specify 3n + 1 points, where n is the number of segments in the curve.

Return Value

Type: Microsoft.Office.Interop.PowerPoint.Shape
Shape

Examples

The following example adds a two-segment Bézier curve to myDocument.

Dim pts(1 To 7, 1 To 2) As Single

pts(1, 1) = 0

pts(1, 2) = 0

pts(2, 1) = 72

pts(2, 2) = 72

pts(3, 1) = 100

pts(3, 2) = 40

pts(4, 1) = 20

pts(4, 2) = 50

pts(5, 1) = 90

pts(5, 2) = 120

pts(6, 1) = 60

pts(6, 2) = 30

pts(7, 1) = 150

pts(7, 2) = 90

Set myDocument = ActivePresentation.Slides(1)

myDocument.Shapes.AddCurveSafeArrayOfPoints:=pts

See Also

Reference

CanvasShapes Interface

CanvasShapes Members

Microsoft.Office.Interop.PowerPoint Namespace