我试图在PowerPoint中创建,每个重复对象与比下一个稍短的运动路径,像这样的一排复制的运动路径的长度:增量使用VBA
我知道你不能在VBA从头开始添加路径动画,所以我用VBA复制和粘贴的对象和它的运动轨迹,然后编辑运动路径。
这是我的VBA代码: 子CopyPastePosition()
' Copy the shape in slide 2 which has a custom motion path aleady
ActivePresentation.Slides(2).Shapes(3).Copy
Dim x As Integer
' For loop - create 5 duplicates
For x = 1 To 5
' Each duplicate is nudged to the left by x*100
With ActivePresentation.Slides(1).Shapes.Paste
.Name = "Smiley"
.Left = x * 100
.Top = 1
End With
' This is where I am unsure - I want the motion path to be longer by x amount each time
ActivePresentation.Slides(1).TimeLine.MainSequence(x).Behaviors(1).MotionEffect.Path = "M 0 0 L 0 x*0.7"
Next x
End Sub
但是,输出是这样的: Second Image
我什么都不知道关于PowerPoint中VBA,但如果我不得不猜测,我会尝试...' “M 0 0 L 0” 和(X * 0.7)' – braX