The following code scales the rectangle to the both sides.
I want to scale the rectangle to the one side.
In other words I want to scale the rectangle from left to right.
Sub Macro1()
'Delete all slides
For i = ActivePresentation.Slides.Count To 1 Step -1
ActivePresentation.Slides(i).Delete
Next i
'Add a blank slide
ActivePresentation.Slides.Add 1, ppLayoutBlank
'Add a Rectangle
With ActivePresentation.Slides(1).Shapes.AddShape(Type:=msoShapeRectangle, Left:=100, Top:=100, Width:=200, Height:=50)
.Name = "myRectangle"
End With
'Add a Scale effect to the myRectangle
With ActivePresentation.Slides(1).TimeLine.MainSequence.AddEffect(Shape:=ActivePresentation.Slides(1).Shapes("myRectangle"), EffectId:=msoAnimEffectCustom, Trigger:=msoAnimTriggerAfterPrevious)
With .Behaviors.Add(msoAnimTypeScale)
'Starting size
.ScaleEffect.FromX = 100
.ScaleEffect.FromY = 100
'Ending size
.ScaleEffect.ToX = 200
.ScaleEffect.ToY = 100
End With
.Timing.SmoothStart = msoTrue
.Timing.SmoothEnd = msoTrue
.Timing.Duration = 5
End With
End Sub
Thanks in advance. Thanks in advance.