How to set Transitions for Powerpoint files in C#

The transition of Slide can make presentation of PPT files more attractive. Spire.Presentation for .NET allows developers to manage or customize the slide transition of the slides. Developers can not only apply different slide transitions on the slides, but also customize the behavior of these transition.

To create simple slide transition and set speed and sound mode for transition, follow the steps below:

Step 1: Download Spire.Presentation and add references in VS.

Step 2: Create an instance of Presentation and add a new presentation file.

Presentation ppt = new Presentation();
ppt.LoadFromFile(fp.TestPath + "first_quarter_business_upd.ppt");

Step 3: There are 23 transition types can be set by Spire.Presentation, such as Circle, Cover, Plus, Push, etc. These transitions can be found in TransitionType enum.

ppt.Slides[0].SlideShowTransition.Type = TransitionType.Push;

How to set Transitions for Powerpoint files in C#

Step 4: We just applied a simple transition on the slide. Now, to make that even better and controlled, we can set the speed of the transition to create a more customized effect. Spire.Presentation offers Fast, Medium, None, Slow 4 options.

ppt.Slides[0].SlideShowTransition.Speed = TransitionSpeed.Slow;

Step 5: Set the transition sound mode such as None, StartSound, StopPreviousSound.

ppt.Slides[0].SlideShowTransition.SoundMode = TransitionSoundMode.StartSound;

Step 6: Finally write the modified presentation as a PPTX file.

ppt.SaveToFile("setTransitons.pptx", FileFormat.Pptx2010);