Table of contents
TOC
Collapse the table of content
Expand the table of content

Shapes.BuildFreeform Method (Project)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Creates a FreeformBuilder object that represents a new freeform drawing. The freeform drawing can be converted into a Shape object.

Syntax

expression. BuildFreeform(EditingType,X1,Y1)

expression A variable that represents a Shapes object.

Parameters

NameRequired/OptionalData TypeDescription
EditingTypeRequiredMsoEditingTypeThe editing property of the first node.
X1RequiredSingleThe position (in points) of the first node in the freeform drawing, relative to the left edge of the report.
Y1RequiredSingleThe position (in points) of the first node in the freeform drawing, relative to the top edge of the report.
EditingTypeRequiredMSOEDITINGTYPE
X1RequiredFLOAT
Y1RequiredFLOAT
NameRequired/OptionalData typeDescription

Return value

FreeformBuilder

Remarks

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.

Example

The following example adds a freeform with five vertices to the report, converts the freeform to a shape, and then changes the background style of the shape.

Sub AddFreeform2()
    Dim shapeReport As Report
    Dim reportName As String
    Dim freeformBuild As FreeformBuilder
    Dim freeformShape As shape

    reportName = "Freeform2 report"
    Set shapeReport = ActiveProject.Reports.Add(reportName)

    Set freeformBuild = shapeReport.Shapes.BuildFreeform(msoEditingCorner, 360, 200)

    With freeformBuild
        .AddNodes msoSegmentCurve, msoEditingCorner, 380, 230, 400, 450, 300
        .AddNodes msoSegmentCurve, msoEditingAuto, 480, 200
        .AddNodes msoSegmentLine, msoEditingAuto, 480, 400
        .AddNodes msoSegmentLine, msoEditingAuto, 360, 200
        .ConvertToShape
    End With

    Set freeformShape = shapeReport.Shapes(1)

    freeformShape.BackgroundStyle = msoBackgroundStylePreset10
End Sub

See also

Other resources

Shapes ObjectShape Object

© 2018 Microsoft