Share via


Shapes.BuildFreeform Method

Publisher Developer Reference

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.
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

Remarks

The EditingType parameter can be one of the following MsoEditingType constants declared in the Microsoft Office type library.

msoEditingAuto Adds a node type appropriate to the segments being connected.
msoEditingCorner Adds a corner node.

Example

For the X1 and Y1 arguments, numeric values are evaluated in points; strings can be in any units supported by Microsoft Office 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 you've defined in the FreeformBuilder object.

Visual Basic for Applications
  ' 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

See Also