开发者

Copying shapes between PowerPoint 2007 presentations along with their animations

开发者 https://www.devze.com 2023-01-19 00:23 出处:网络
I programmatically copy the shapes of an entire slide to a new slide in another presentation by performing origShape.Copy and then newSlide.Shapes.Paste().

I programmatically copy the shapes of an entire slide to a new slide in another presentation by performing origShape.Copy and then newSlide.Shapes.Paste(). (copy/paste the entire slide is unfortunately not an option for me here)

My problem is that Animation effects get really warped. Some are lost, others appear in the wrong order.

I thought that maybe after copying all the shapes I'll go over origSlide.TimeLine and will copy each an开发者_JAVA百科imation effect to newSlide.TimeLine with the corresponding Shapes.

Is there a way of copying Animation effects between shapes without manually setting each and every parameter? (there are LOTS of these).


When copying shape-by-shape to a new slide, naturally the order of the animations gets ruined. If we had for example the following animation sequence:

  1. Rectangle flying in
  2. Triangle flying in
  3. Rectangle flying out

And we copy first the Rectangle and then the Triangle to a new slide, we'll get first both animations of the rectangle and then of the triangle.

My mistake was trying to solve this disorder by using Shape.AnimationSettings.

BEWARE OF SHAPE.ANIMATIONSETTINGS!!

This Property is kept only for backward compatibility with old versions of PowerPoint. If you modify any of its fields, all animations of a shape except the first one get AUTOMATICALLY ERASED !

So, the solution is this: Copy shape by shape to new slide (no animations are lost, just mis-ordered). Then use Slide.TimeLine to go over the animation Effects and order them correctly using Effect.MoveTo, or Sequence.Clone and Effect.Delete.

0

精彩评论

暂无评论...
验证码 换一张
取 消