Share via


ShapeNodes.SetPosition Method

Sets the location of the node specified by Index. Note that, depending on the editing type of the node, this method may affect the position of adjacent nodes.

Namespace:  Microsoft.Office.Interop.PowerPoint
Assembly:  Microsoft.Office.Interop.PowerPoint (in Microsoft.Office.Interop.PowerPoint.dll)

Syntax

'Declaration
Sub SetPosition ( _
    Index As Integer, _
    X1 As Single, _
    Y1 As Single _
)
'Usage
Dim instance As ShapeNodes
Dim Index As Integer
Dim X1 As Single
Dim Y1 As Single

instance.SetPosition(Index, X1, Y1)
void SetPosition(
    int Index,
    float X1,
    float Y1
)

Parameters

  • Index
    Type: System.Int32
    The node whose position is to be set.
  • Y1
    Type: System.Single
    The x-position (in points) of the new node relative to the upper-left corner of the document.
    The y-position (in points) of the new node relative to the upper-left corner of the document.

Examples

This example moves node two in shape three on myDocument to the right 200 points and down 300 points. Shape three must be a freeform drawing.

Set myDocument = ActivePresentation.Slides(1)

With myDocument.Shapes(3).Nodes

    pointsArray = .Item(2).Points

    currXvalue = pointsArray(1, 1)

    currYvalue = pointsArray(1, 2)

    .SetPosition2, currXvalue + 200, currYvalue + 300

End With

See Also

Reference

ShapeNodes Interface

ShapeNodes Members

Microsoft.Office.Interop.PowerPoint Namespace