The following code scales the rectangle through to both sides. (left and right)
I want to scale the rectangle through to right side only. How can I do that?
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.Duration = 3
End With
End Sub