다음을 통해 공유


ShapeNodes.Insert Method (Excel)

Inserts a node into a freeform shape.

Syntax

.Insert(Index, SegmentType, EditingType, X1, Y1, X2, Y2, X3, Y3)

A variable that represents a ShapeNodes object.

Parameters

Name

Required/Optional

Data Type

Description

Index

필수

Integer

Long. The number of the shape node after which to insert a new node.

SegmentType

필수

MsoSegmentType

The segment type.

EditingType

필수

MsoEditingType

The editing type.

X1

필수

Single

If the EditingType of the new segment is msoEditingAuto, this argument specifies the horizontal distance, measured 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, measured in points, from the upper-left corner of the document to the first control point for the new segment.

Y1

필수

Single

If the EditingType of the new segment is msoEditingAuto, this argument specifies the vertical distance, measured 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 vertical distance, measured in points, from the upper-left corner of the document to the first control point for the new segment.

X2

필수

Single

If the EditingType of the new segment is msoEditingCorner, this argument specifies the horizontal distance, measured 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

필수

Single

If the EditingType of the new segment is msoEditingCorner, this argument specifies the vertical distance, measured 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

필수

Single

If the EditingType of the new segment is msoEditingCorner, this argument specifies the horizontal distance, measured in points, from the upper-left corner of the document to the end point of the new segment. If the EditingType of the new segment is msoEditingAuto, don't specify a value for this argument.

Y3

필수

Single

If the EditingType of the new segment is msoEditingCorner, this argument specifies the vertical distance, measured in points, from the upper-left corner of the document to the end point of the new segment. If the EditingType of the new segment is msoEditingAuto, don't specify a value for this argument.

Example

This example selects the third shape in the active document, checks whether the shape is a Freeform object, and if it is, inserts a node. This example assumes three shapes exist on the active worksheet.

Sub InsertShapeNode() 
    ActiveSheet.Shapes(3).Select 
    With Selection.ShapeRange 
        If .Type = msoFreeform Then 
            .Nodes.Insert _ 
                Index:=3, SegmentType:=msoSegmentCurve, _ 
                EditingType:=msoEditingSymmetric, X1:=35, Y1:=100 
            .Fill.ForeColor.RGB = RGB(0, 0, 200) 
            .Fill.Visible = msoTrue 
        Else 
            MsgBox "This shape is not a Freeform object." 
        End If 
    End With 
End Sub

참고 항목

개념

ShapeNodes Object Members

ShapeNodes Object