Share via


Slide.MoveTo Method

PowerPoint Developer Reference

Moves the specified object to a specific location within the same collection, renumbering all other items in the collection appropriately.

Syntax

expression.MoveTo(toPos)

expression   A variable that represents a Slide object.

Parameters

Name Required/Optional Data Type Description
toPos Required Long The index position to which to move the animation effect.

Example

This example moves an animation effect to the second in the animation effects collection for the specified shape.

Visual Basic for Applications
  Sub MoveEffect()
    Dim sldFirst as Slide
    Dim shpFirst As Shape
    Dim effAdd As Effect
Set sldFirst = ActivePresentation.Slides(1)
Set shpFirst = sldFirst.Shapes(1)

Set effAdd = sldFirst.TimeLine.MainSequence.AddEffect _
    (Shape:=shpFirst, effectId:=msoAnimEffectBlinds)

effAdd.<strong>MoveTo</strong> toPos:=2

End Sub

This example moves the second slide in the active presentation to the first slide.

Visual Basic for Applications
  Sub MoveSlideToNewLocation()
    ActivePresentation.Slides(2).MoveTo toPos:=1
End Sub

See Also