ShapeNodes.Insert method (PowerPoint)
Inserts a new segment after the specified node of the freeform.
Syntax
expression.Insert (Index, SegmentType, EditingType, X1, Y1, X2, Y2, X3, Y3)
expression A variable that represents an ShapeNodes object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
Index | Required | Long | The node that the new node is to be inserted after. |
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 endpoint 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 vertical distance (in points) from the upper-left corner of the document to the endpoint of the new segment. If the EditingType of the new node is msoEditingCorner, this argument specifies the vertical distance (in points) from the upper-left corner of the document to the first control point for the new segment. |
X2 | Optional | Single | 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 | Single | If the EditingType of the new segment is msoEditingCorner, this argument specifies the vertical 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 | Single | 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 endpoint of the new segment. If the EditingType of the new segment is msoEditingAuto, don't specify a value for this argument. |
Y3 | Optional | Single | If the EditingType of the new segment is msoEditingCorner, this argument specifies the vertical distance (in points) from the upper-left corner of the document 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
The SegmentType parameter value can be one of these MsoSegmentType constants.
msoSegmentCurve |
msoSegmentLine |
The EditingType parameter value can be one of these MsoEditingType constants.
msoEditingAuto |
msoEditingCorner |
Example
This example adds a smooth node with a curved segment after node four in shape three on myDocument. Shape three must be a freeform drawing with at least four nodes.
Set myDocument = ActivePresentation.Slides(1)
With myDocument.Shapes(3).Nodes
.Insert Index:=4, SegmentType:=msoSegmentCurve, _
EditingType:=msoEditingSmooth, X1:=210, Y1:=100
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.