Share via


FreeformBuilder.ConvertToShape Method

Publisher Developer Reference

Creates a shape that has the geometric characteristics of the specified FreeformBuilder object. Returns a Shape object that represents the new shape.

Syntax

expression.ConvertToShape

expression   A variable that represents a FreeformBuilder object.

Return Value
Shape

Remarks

You must apply the AddNodes method to a FreeformBuilder object at least once before you use the ConvertToShape method or an error occurs.

Example

This example adds a freeform with four vertices to the first page in the active publication.

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.
.<strong class="bterm">ConvertToShape</strong>

End With

See Also