I am able to grow the rectangle horizontal and vertical via following code.
But I want to grow the rectangle only horizontal.
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 GrowShrink effect to the myRectangle
With ActivePresentation.Slides(1).TimeLine.MainSequence.AddEffect(Shape:=ActivePresentation.Slides(1).Shapes("myRectangle"), EffectId:=msoAnimEffectGrowShrink)
.EffectParameters.Size = 150
'The following code doesnt work
'.EffectParameters.Direction = msoAnimDirectionHorizontal
End With
End Sub
Thanks in advance.