Animated text in PowerPoint presentations is used to draw the attention of the audience. Moreover, it brings life to the content of the presentations. You can apply animation effects to text, shapes, and the slides. In this article, you will learn how to apply animation to the text in PowerPoint using C#.
- API to Apply Animation to Text in PowerPoint
- Apply Animation to Text in PowerPoint
- Get Animation Effects from a Text in PowerPoint
C# API to Apply Animation to Text in PowerPoint
To apply animation to the text in PowerPoint presentations, we will use Aspose.Slides for .NET. It is a feature-rich and easy-to-use API for creating and manipulating PowerPoint and OpenOffice presentations. You can either download the API or install it using NuGet.
PM> Install-Package Aspose.Slides.NET
Apply Animation to Text in PowerPoint PPT in C#
Aspose.Slides for .NET provides the support of over 150 animation effects including Bounce, PathFootball, Zoom, etc. Moreover, it also provides specific animation effects such as OLEObjectShow and OLEObjectOpen. All the supported animation effects are listed in EffectType enumeration.
The following are the steps to apply animation to text in a PowerPoint presentation using C#.
- First, load the presentation using Presentation class.
- Select the desired paragraph in an IParagraph object from the desired slide.
- Apply animation effect to the text using Presentation.Slides[index].Timeline.MainSequence.AddEffect() method.
- Finally, save the presentation using Presentation.Save(String, SaveFormat) method.
The following code sample shows how to apply an animation effect to text in a PowerPoint PPT in C#.
C# Get Animation Effects from a Text in PowerPoint PPT
You can also get information about the animation effect which is applied to a particular text. This can be useful when you need to apply the same effect to another text in the presentation.
The following are the steps to get information about the animation effect applied to a text.
- First, load the presentation using Presentation class.
- Get sequence of the desired slide in ISequence object.
- Access the shape from the selected slide in an IAutoShape object.
- Loop through each IParagraph in IAutoShape.TextFrame.Paragraphs collection.
- Finally, get the effects in an IEffect array using ISequence.GetEffectsByParagraph(iParagraph) method.
The following code sample shows how to get the information about a text’s animation effect.
C# .NET PowerPoint API - Get a Free License
You can use Aspose.Slides for .NET without evaluation limitations by requesting a temporary license.
Conclusion
In this article, you have learned how to apply animation effects on text in PowerPoint presentations using C#. Furthermore, you have also seen how to get animation effects from a text in a PowerPoint presentation.
Aspose.Slides for .NET
In order to explore other features of Aspose.Slides for .NET, you can visit the documentation. Also, you can feel free to let us know about your queries via our forum.