Shapes.BuildFreeform method (Publisher)

Builds a freeform object. Returns a FreeformBuilder object that represents the freeform as it is being built.

Syntax

expression.BuildFreeform (EditingType, X1, Y1)

expression A variable that represents a Shapes object.

Parameters

Name Required/Optional Data type Description
EditingType Required MsoEditingType Specifies the editing type of the first node. Can be one of the MsoEditingType constants declared in the Microsoft Office type library.
X1 Required Variant The horizontal position of the first node in the freeform drawing relative to the upper-left corner of the page.
Y1 Required Variant The vertical position of the first node in the freeform drawing relative to the upper-left corner of the page.

Return value

FreeformBuilder

Example

For the X1 and Y1 arguments, numeric values are evaluated in points; strings can be in any units supported by Microsoft Publisher (for example, "2.5 in").

Use the AddNodes 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 Shape object that has the geometric description that you defined in the FreeformBuilder object.

' Add a new freeform object. 
With ActiveDocument.Shapes _ 
 .BuildFreeform(EditingType:=msoEditingCorner, _ 
 X1:=100, Y1:=100) 
 
 ' Add three more nodes and close the polygon. 
 .AddNodes SegmentType:=msoSegmentCurve, _ 
 EditingType:=msoEditingCorner, _ 
 X1:=200, Y1:=200, X2:=225, Y2:=250, X3:=250, Y3:=200 
 .AddNodes SegmentType:=msoSegmentCurve, _ 
 EditingType:=msoEditingAuto, X1:=200, Y1:=100 
 .AddNodes SegmentType:=msoSegmentLine, _ 
 EditingType:=msoEditingAuto, X1:=150, Y1:=50 
 .AddNodes SegmentType:=msoSegmentLine, _ 
 EditingType:=msoEditingAuto, X1:=100, Y1:=100 
 
 ' Convert the polygon to a Shape object. 
 .ConvertToShape 
End With 
 

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.