PPT.PickupAndApplyAnimation in MS PowerPoint 2010 to Copy Animations in VB.NET

In this article I am going to explain about how to Copy Animations in a Microsoft PowerPoint 2010 presentation.
  • 2770

Introduction

In this article I am going to explain about how to Copy Animations in a Microsoft PowerPoint 2010 presentation. For this we use PPT.PickupAndApplyAnimation in Microsoft PowerPoint 2010. Using ApplyAnimation method you can apply the animation to a specific shape.

Microsoft Office 2010 offer some powerful tools, using this tools you can create application. Using Microsoft Visual Basic for Applications (VBA) you can create your own application according to your need. These application can performer some specific task.

For creating application we can use

  • VBA host of Excel 2010
  • VBA host of PowerPoint 2010
  • VBA host of Word 2010

NOTE : OneNote 2010 is not a VBA host.

Code that we use in this application are given below

Sub TestPickupAnimation() 

    With ActivePresentation.Slides(1)
        Dim vip1, vip2, vip3 As Shape
        vip1 = .Shapes.AddShape(msoShape12pointStar, 20, 20, 100, 100)
        .TimeLine.MainSequence.AddEffect(vip1, msoAnimEffectFadedSwivel, , 
         msoAnimTriggerAfterPrevious)
        .TimeLine.MainSequence.AddEffect(vip1, msoAnimEffectPathBounceRight, , 
         msoAnimTriggerAfterPrevious)
        .TimeLine.MainSequence.AddEffect(vip1, msoAnimEffectSpin, , 
         msoAnimTriggerAfterPrevious) 

        ' Now create a second shape, and apply the same animation to it:

        vip1.PickupAnimation()
        vip2 = .Shapes.AddShape(msoShapeHexagon, 100, 20, 100, 100)
        vip2.ApplyAnimation() 

        ' And one more:

        vip3 = .Shapes.AddShape(msoShapeCloud, 180, 20, 100, 100)
        vip3.ApplyAnimation() 

    EndWith

EndSub

Step for creating Application

Step 1 : Start Microsoft PowerPoint 2010 :

1.jpg

Step 2 : Using Alt + F11 Key Start Visual Basic for Applications (VBA) Window :

2.jpg

Step 3 : Select on VBAProject(Presentation 1) :

3.jpg

Step 4 : Right Click On VBAProject(Presentation 1) ==> Goto Insert==> Goto Module & click on Module:

4.jpg

5.jpg

Step 5 : Write Code in Visual Basic for Applications (VBA) Window :

 

Clipboard12.jpg

Step 6 : Run Application using F5 :

Step 7 : Macros window will open, Select Macros name and click on Run Button :

Clipboard07.jpg
 

Step 8 : Output of Application :

Clipboard05.jpg
 

Clipboard10.jpg

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.