我試圖用另一種類型(矩形形狀)的形狀對象替換幻燈片(圖片)上的所有形狀對象。我可以刪除舊對象並創建新對象,但是我將放棄所有動畫信息和序列順序。是否有可能在時間軸中存儲動畫信息和順序,並將其複製到新的形狀對象?在PowerPoint形狀之間複製動畫和序列信息
0
A
回答
2
嗯,我已經找到了自己的解決方案,希望有人能找到它有用。因此,不需要將動畫信息從舊形狀複製到新形狀,只需循環序列的項目並將形狀對象參考替換爲新形狀即可。像這樣:
On Error Resume Next
Dim shp1 As Shape 'old shape
Set shp1 = ActivePresentation.Slides(1).Shapes(3)
Dim shp2 As Shape 'new shape
Set shp2 = ActivePresentation.Slides(1).Shapes.AddPicture("c:\imgres2.jpg", msoFalse, msoTrue, 0, 0) 'it is important to create new shape before cycling through existing ones.
For i = ActivePresentation.Slides(1).TimeLine.MainSequence.count To 1 Step -1
'using "is" opeartor to compare refrences
If shp1 Is ActivePresentation.Slides(1).TimeLine.MainSequence.Item(i).Shape Then
ActivePresentation.Slides(1).TimeLine.MainSequence.Item(i).Shape = shp2
End If
Next i
shp1.Delete 'delete the old shape
0
嘗試是這樣的代碼,以動畫複製到新增加的形狀:
Sub PasteAnimationBehaviours()
Dim SHP As Shape 'for existing shape
Set SHP = ActivePresentation.Slides(1).Shapes(1)
SHP.PickupAnimation
Dim newSHP As Shape 'pasting to new shape
Set newSHP = ActivePresentation.Slides(1).Shapes.AddShape(msoShapeRectangle, 100, 100, 100, 100)
newSHP.ApplyAnimation
End Sub
添加評論後:如果您只需要更換形狀的類型嘗試使用這樣的:
Sub ShapeSubstition()
Dim SHP As Shape 'for existing shape
'test for 1st shape in 1st slide
Set SHP = ActivePresentation.Slides(1).Shapes(1)
SHP.AutoShapeType = msoShapeRectangle 'to rectangle
SHP.AutoShapeType = msoShapeOval 'to oval
End Sub
0
我認爲使用「Animation Painter」命令按鈕複製動畫並將它們應用到另一個對象可能更容易。動畫畫家的功能與格式畫家相同。複製完所需動畫後,可以使用動畫窗格重新排列單個動畫。
相關問題
- 1. 複製PowerPoint 2007演示文稿之間的形狀及其動畫
- 2. PowerPoint:在rectantgle之間的動畫箭頭
- 3. KineticJS在兩個形狀之間畫線
- 4. PowerPoint形狀不在形狀集合
- 5. 如何在VBA中的形狀之間複製Visio形狀表部分
- 6. 在PowerPoint中使用VBA複製粘貼形狀
- 7. Powerpoint VBA使複製形狀視圖處於活動狀態以選擇分組
- 8. 在CSS狀態之間動畫?
- 9. Powerpoint更改形狀輪廓/使用動畫填充顏色
- 10. 如何獲得Powerpoint形狀的動畫屬性?
- 11. HTML畫布 - 間隔後繪製形狀
- 12. 如何繪製畫布形狀之間的對角線
- 13. 在html畫布之間複製pixeldata
- 14. Silverlight:重複故事板形狀動畫
- 15. SQL Server在數據庫之間複製表信息
- 16. 在數據庫之間移動信息
- 17. 編程與複製源格式的形狀(PowerPoint 2007中)
- 18. PowerPoint VBA - 將形狀複製到幻燈片
- 19. VBA如何從Word複製圖像/內聯形狀到powerpoint
- 20. 動畫「fillLinearGradientColorStops」形狀
- 21. iOS形狀動畫
- 22. QuartzCore動畫形狀?
- 23. Android形狀動畫
- 24. android - 動畫形狀
- 25. 兩個貝塞爾路徑形狀之間的動畫
- 26. 在ActionScript和Lingo之間交換信息
- 27. python ood - 類之間的重複信息
- 28. 在補間動畫之前顯示的可繪製的圖形
- 29. Java畫家程序繪製形狀
- 30. 在MySQL Workbench中移動和複製表之間的列
謝謝你的回答!但是它部分地解決了這個問題,但新的形狀動畫被添加到序列時間線的末尾。我如何將新形狀的動畫移動到指定的位置? – Andrey