BuildFreeform Method

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.  

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

expression.BuildFreeform(EditingType, X1, Y1)

expression   Required. An expression that returns one of the objects in the Applies To list.

MsoEditingType

MsoEditingType can be one of these MsoEditingType constants.
msoEditingAuto  Adds a node type appropriate to the segments being connected.
msoEditingCorner  Adds a corner node.
msoEditingSmooth  Not used with this method.
msoEditingSymmetric  Not used with this method.

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.

Remarks

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 you've defined in the FreeformBuilder object.

Example

This example adds a freeform with four segments to the first page of the active publication.

  ' 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