CanvasShapes.BuildFreeform Method
Builds a freeform object. Returns a FreeformBuilder object that represents the freeform as it is being built.
Namespace: Microsoft.Office.Interop.PowerPoint
Assembly: Microsoft.Office.Interop.PowerPoint (in Microsoft.Office.Interop.PowerPoint.dll)
Syntax
'Declaration
Function BuildFreeform ( _
EditingType As MsoEditingType, _
X1 As Single, _
Y1 As Single _
) As FreeformBuilder
'Usage
Dim instance As CanvasShapes
Dim EditingType As MsoEditingType
Dim X1 As Single
Dim Y1 As Single
Dim returnValue As FreeformBuilder
returnValue = instance.BuildFreeform(EditingType, _
X1, Y1)
FreeformBuilder BuildFreeform(
MsoEditingType EditingType,
float X1,
float Y1
)
Parameters
- EditingType
Type: Microsoft.Office.Core.MsoEditingType
The editing property of the first node.
- X1
Type: System.Single
The horizontal position, measured in points, of the first node in the freeform drawing relative to the left edge of the slide.
- Y1
Type: System.Single
The vertical position, measured in points, of the first node in the freeform drawing relative to the top edge of the slide.
Return Value
Type: Microsoft.Office.Interop.PowerPoint.FreeformBuilder
FreeformBuilder
Remarks
Use the AddNodes(MsoSegmentType, MsoEditingType, Single, Single, Single, Single, Single, Single) method to add segments to the freeform. After you have added at least one segment to the freeform, you can use the ConvertToShape() method to convert the FreeformBuilder object into a CanvasShapes object that has the geometric description you've defined in the FreeformBuilder object.
Examples
This example adds a freeform with four segments to myDocument.
Set myDocument = ActivePresentation.Slides(1)
With myDocument.Shapes.BuildFreeform(EditingType:=msoEditingCorner, _
X1=360, Y1=200)
.AddNodes SegmentType:=msoSegmentCurve, EditingType:=msoEditingCorner, _
X1:=380, Y1:=230, X2:=400, Y2:=250, X3:=450, Y3:=300
.AddNodes SegmentType:=msoSegmentCurve, EditingType:=msoEditingAuto, _
X1:=480, Y1:=200
.AddNodes SegmentType:=msoSegmentLine, EditingType:=msoEditingAuto, _
X1:=480, Y1:=400
.AddNodes SegmentType:=msoSegmentLine, EditingType:=msoEditingAuto, _
X1:=360, Y1:=200
.ConvertToShape
End With