Редагувати

Поділитися через


FreeformBuilder.AddNodes method (Excel)

Adds a point in the current shape, and then draws a line from the current node to the last node that was added.

Syntax

expression.AddNodes (SegmentType, EditingType, X1, Y1, X2, Y2, X3, Y3)

expression A variable that represents a FreeformBuilder object.

Parameters

Name Required/Optional Data type Description
SegmentType Required MsoSegmentType The type of segment to be added.
EditingType Required MsoEditingType The editing property of the vertex.
X1 Required Single If the EditingType of the new segment is msoEditingAuto, this argument specifies the horizontal distance (in points) from the upper-left corner of the document to the end point of the new segment.

If the EditingType of the new node is msoEditingCorner, this argument specifies the horizontal distance (in points) from the upper-left corner of the document to the first control point for the new segment.
Y1 Required Single If the EditingType of the new segment is msoEditingAuto, this argument specifies the horizontal distance (in points) from the upper-left corner of the document to the end point of the new segment.

If the EditingType of the new node is msoEditingCorner, this argument specifies the horizontal distance (in points) from the upper-left corner of the document to the first control point for the new segment.
X2 Optional Variant If the EditingType of the new segment is msoEditingCorner, this argument specifies the horizontal distance (in points) from the upper-left corner of the document to the second control point for the new segment.

If the EditingType of the new segment is msoEditingAuto, don't specify a value for this argument.
Y2 Optional Variant If the EditingType of the new segment is msoEditingCorner, this argument specifies the horizontal distance (in points) from the upper-left corner of the document to the second control point for the new segment.

If the EditingType of the new segment is msoEditingAuto, don't specify a value for this argument.
X3 Optional Variant If the EditingType of the new segment is msoEditingCorner, this argument specifies the horizontal distance (in points) from the upper-left corner of the document to the second control point for the new segment.

If the EditingType of the new segment is msoEditingAuto, don't specify a value for this argument.
Y3 Optional Variant If the EditingType of the new segment is msoEditingCorner, this argument specifies the horizontal distance (in points) from the upper-left corner of the document to the second control point for the new segment.

If the EditingType of the new segment is msoEditingAuto, don't specify a value for this argument.

Remarks

MsoEditingType cannot be msoEditingSmooth or msoEditingSymmetric. If SegmentType is msoSegmentLine, EditingType must be msoEditingAuto.

Example

This example adds a freeform with four segments to myDocument.

Set myDocument = Worksheets(1) 
With myDocument.Shapes.BuildFreeform(msoEditingCorner, 360, 200) 
    .AddNodes msoSegmentCurve, msoEditingCorner, _ 
        380, 230, 400, 250, 450, 300 
    .AddNodes msoSegmentCurve, msoEditingAuto, 480, 200 
    .AddNodes msoSegmentLine, msoEditingAuto, 480, 400 
    .AddNodes msoSegmentLine, msoEditingAuto, 360, 200 
    .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.