FreeformBuilder.AddNodes method (Publisher)

Inserts a new segment at the end of the freeform that is being created, and adds the nodes that define the segment.

Use this method as many times as you want to add nodes to the freeform that you are creating. When you finish adding nodes, use the ConvertToShape method to create the freeform that you just defined.

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. Can be msoSegmentCurve or msoSegmentLine.
EditingType Required MsoEditingType The editing type of the new node. Can be msoEditingAuto or msoEditingCorner.

If SegmentType is msoSegmentLine, EditingType must be msoEditingAuto; otherwise, an error occurs.
X1 Required Variant If the EditingType of the new segment is msoEditingAuto, this argument specifies the horizontal distance from the upper-left corner of the page to the endpoint of the new segment.

If the EditingType of the new node is msoEditingCorner, this argument specifies the horizontal distance from the upper-left corner of the page to the first control point for the new segment.
Y1 Required Variant If the EditingType of the new segment is msoEditingAuto, this argument specifies the vertical distance from the upper-left corner of the page to the endpoint of the new segment.

If the EditingType of the new node is msoEditingCorner, this argument specifies the vertical distance from the upper-left corner of the page 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 from the upper-left corner of the page 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 vertical distance from the upper-left corner of the page 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 from the upper-left corner of the page to the endpoint of 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 msoEditingAuto, this argument specifies the vertical distance from the upper-left corner of the page to the endpoint of the new segment.

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

Remarks

For the X1, Y1, X2, Y2, X3, and Y3 arguments, numeric values are evaluated in points; strings can be in any units supported by Microsoft Publisher (for example, "2.5 in").

To add nodes to a freeform after it is created, use the Insert method of the ShapeNodes collection.

Example

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

' Add a new freeform object. 
With ActiveDocument.Pages(1).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 

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.