Unfortunately this is not simple to understand and you really need to understand VML paths.
Here's the code to move left (or right with postive values) in code by a set amount.
The VML Path is
M= Motion
0 0 From current position
L=Line
amount left measures in fractions of slide width
amount up and down in fractions oof slide height
E=End
Try this with various values and make sure the rectangle is selected.
Sub Left_xx()
Dim oshp As Shape
Dim oeff As Effect
Dim osld As Slide
Dim swCm
Dim HowFarLeft As Single
HowFarLeft = 7 'change this
swCm = Points2cm(ActivePresentation.PageSetup.SlideWidth)
If ActiveWindow.Selection.ShapeRange.Count <> 1 Then Exit Sub
Set oshp = ActiveWindow.Selection.ShapeRange(1)
Set osld = oshp.Parent
Set oeff = osld.TimeLine.MainSequence.AddEffect(oshp, msoAnimEffectPathLeft, msoAnimateLevelNone, msoAnimTriggerOnPageClick)
oeff.Behaviors(1).MotionEffect.Path = "M 0 0 L " & CStr(-(HowFarLeft / swCm)) & " 0 E"
End Sub
Function Points2cm(inVal As Single) As Single
Points2cm = inVal / 28.346
End Function
|