FreeformBuilder Object (Publisher)

Represents the geometry of a freeform while it is being built.

Use the BuildFreeform method of the Shapes collection to return a FreeformBuilder object. Use the AddNodes method to add nodes to the freeform. Use the ConvertToShape method to create the shape defined in the FreeformBuilder object and add it to the Shapes collection. The following example adds a freeform with four segments to the active document.

Sub CreateNewFreeFormShape() 
 With ActiveDocument.Pages(1).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 
 End With 
End Sub
© 2014 Microsoft