title: Powerpoint VBA: How to specify the direction of a Float In Entrance Effect
body: <p>I am trying to add a float in entrance effect to an picture using VBA in Microsoft Office PowerPoint.</p>
  
  <p>I would like the float in animation to go in the <strong>downwards</strong> direction</p>
  
  <p>Here is my code:</p>
  
  <pre><code>Sub add_pic_float_in()
  
  
  ' Insert the Picture
  Set myDocument = ActivePresentation.Slides(1)
  
  myDocument.Shapes.AddPicture FileName:="C:\Users\forson\Pictures\Picture.svg", LinkToFile:=msoTrue, SaveWithDocument:=msoTrue, _
      Left:=a * 10, Top:=-1000, Width:=359.055, Height:=1284.803
  
  ' Crop the Image
      With myDocument.Shapes(1)
          .Name = "Picture 1"
          .PictureFormat.CropLeft = 140
          .PictureFormat.CropRight = 130
          .PictureFormat.CropTop = 650
      End With
  
  ' Create shape
  Dim picture As Shape
  
  Set picture = myDocument.Shapes(1)
  
  ' Create Effect
  Dim floatin As Effect
  
  ' Set Effect to Picture
  
  Set floatin = myDocument.TimeLine.MainSequence.AddEffect(Shape:=picture, effectId:=msoAnimEffectFloat)
          floatin.Timing.Duration = 1
          floatin.EffectParameters.Direction = msoAnimDirectionDown
          floatin.Timing.TriggerType = msoAnimTriggerWithPrevious
  
  End Sub
  </code></pre>
  
  <p>However, I run into this error:</p>
  
  <p>"Run-time error": '-2147188160 (80048240)': EffectParameters (unknown member): invalid request."</p>
  
  <p>And when I remove the line "floatin.EffectParameters.Direction = msoAnimDirectionDown", it produces an object with an animation, but it is not a "float in" animation.</p>
  
  <p>I have tried looking <a href="https://msdn.microsoft.com/en-us/vba/powerpoint-vba/articles/effect-effecttype-property-powerpoint" rel="nofollow noreferrer">here</a> and <a href="https://msdn.microsoft.com/en-us/vba/powerpoint-vba/articles/msoanimeffect-enumeration-powerpoint" rel="nofollow noreferrer">here</a> but I cannot find a solution.</p>