我試圖在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