Add and edit transitions in PowerPoint slides

19 Sep 202317 minutes to read

Slide transitions are the motion effects that occur when you move from one slide to the next during a slide show presentation. A transition can be simple as push type that pushes to the next slide or an airplane type that displays the next slide like an eye-catching effect. You can control the speed, add sound, and customize the properties of transition effects. Transition effects can be grouped into three categories.

  1. Subtle
  2. Exciting
  3. Dynamic Content

Transition effect contains the following properties. This makes slide transition more flexible and interactive. 

  1. Start (after a click or after certain time)
  2. Duration
  3. Speed

Set a transition effect to a PowerPoint slide

The following code example demonstrates how to set a transition effect to a PowerPoint slide.

//Create a PowerPoint presentation
IPresentation pptxDoc = Presentation.Create();
//Add a blank slide to the presentation
ISlide slide = pptxDoc.Slides.Add(SlideLayoutType.Blank);
//Add a shape to the slide
IShape cubeShape = slide.Shapes.AddShape(AutoShapeType.Cube, 50, 200, 300, 300);
//Set the transition effect type 
slide.SlideTransition.TransitionEffect = TransitionEffect.Checkerboard;
//Set the transition effect options
slide.SlideTransition.TransitionEffectOption = TransitionEffectOption.Across;
//Save the PowerPoint Presentation as stream
FileStream outputStream = new FileStream(OutputFileName, FileMode.Create);
pptxDoc.Save(outputStream);
//Close the presentation
pptxDoc.Close();
//Create a PowerPoint presentation
IPresentation pptxDoc = Presentation.Create();
//Add a blank slide to the presentation
ISlide slide = pptxDoc.Slides.Add(SlideLayoutType.Blank);
//Add a shape to the slide
IShape cubeShape = slide.Shapes.AddShape(AutoShapeType.Cube, 50, 200, 300, 300);
//Set the transition effect type 
slide.SlideTransition.TransitionEffect = TransitionEffect.Checkerboard;
//Set the transition effect options
slide.SlideTransition.TransitionEffectOption = TransitionEffectOption.Across;
//Save the presentation
pptxDoc.Save("Sample.pptx");
//Close the presentation
pptxDoc.Close();
'Create a PowerPoint presentation
Dim pptxDoc As IPresentation = Presentation.Create()
'Add a blank slide to the presentation
Dim slide As ISlide = pptxDoc.Slides.Add(SlideLayoutType.Blank)
'Add a shape to the slide
Dim cubeShape As IShape = slide.Shapes.AddShape(AutoShapeType.Cube, 50, 200, 300, 300)
'Set the transition effect type
slide.SlideTransition.TransitionEffect = TransitionEffect.Checkerboard
'Set the transition effect option
slide.SlideTransition.TransitionEffectOption = TransitionEffectOption.Across
'Save the presentation
pptxDoc.Save("Sample.pptx")
'Close the presentation
pptxDoc.Close()

You can download a complete working sample from GitHub.

Modify a transition effect applied to a PowerPoint slide

You can edit the transition effects that already applied to the PowerPoint slides. Refer to the following code example.

//Loads or open an PowerPoint Presentation
FileStream inputStream = new FileStream("Sample.pptx",FileMode.Open);
IPresentation pptxDoc = Presentation.Open(inputStream);
//Retrieve the first slide from the presentation
ISlide slide = pptxDoc.Slides[0];
//Modify the transition effect applied to the slide
slide.SlideTransition.TransitionEffect = TransitionEffect.Cover;
//Set the transition subtype
slide.SlideTransition.TransitionEffectOption = TransitionEffectOption.Right;
//Save the PowerPoint Presentation as stream
FileStream outputStream = new FileStream("Transition.pptx", FileMode.Create);
pptxDoc.Save(outputStream);
//Close the presentation
pptxDoc.Close();
//Open an existing PowerPoint presentation
IPresentation pptxDoc = Presentation.Open("Sample.pptx");
//Retrieve the first slide from the presentation
ISlide slide = pptxDoc.Slides[0];
//Modify the transition effect applied to the slide
slide.SlideTransition.TransitionEffect = TransitionEffect.Cover;
//Set the transition subtype
slide.SlideTransition.TransitionEffectOption = TransitionEffectOption.Right;
//Save the presentation
pptxDoc.Save("Transition.pptx");
//Close the presentation
pptxDoc.Close();
'Open an existing PowerPoint presentation
Dim pptxDoc As IPresentation = Presentation.Open("Sample.pptx")
'Retrieve the first slide from the presentation
Dim slide As ISlide = pptxDoc.Slides(0)
'Modify the transition effect applied to the slide
slide.SlideTransition.TransitionEffect = TransitionEffect.Cover
'Set the transition subtype
slide.SlideTransition.TransitionEffectOption = TransitionEffectOption.Right
'Save the presentation
pptxDoc.Save("Transition.pptx")
'Close the presentation
pptxDoc.Close()

You can download a complete working sample from GitHub.

Set the transition duration

You can set the transition duration value up to 59 seconds. This specifies the length of the slide transition to happen. Refer to the following code example.

//Create a PowerPoint presentation
IPresentation pptxDoc = Presentation.Create();
//Add a blank slide to the presentation
ISlide slide = pptxDoc.Slides.Add(SlideLayoutType.Blank);
//Add a shape to the slide
IShape cubeShape = slide.Shapes.AddShape(AutoShapeType.Cube, 50, 200, 300, 300);
//Set the transition effect type
slide.SlideTransition.TransitionEffect = TransitionEffect.Checkerboard;
// Set the duration in seconds for the transition effect. Maximum duration value is 59 seconds
slide.SlideTransition.Duration = 40;
//Save the PowerPoint Presentation as stream
FileStream outputStream = new FileStream("Transition.pptx", FileMode.Create);
pptxDoc.Save(outputStream);
//Close the presentation
pptxDoc.Close();
//Create a PowerPoint presentation
IPresentation pptxDoc = Presentation.Create();
//Add a blank slide to the presentation
ISlide slide = pptxDoc.Slides.Add(SlideLayoutType.Blank);
//Add a shape to the slide
IShape cubeShape = slide.Shapes.AddShape(AutoShapeType.Cube, 50, 200, 300, 300);
//Set the transition effect type
slide.SlideTransition.TransitionEffect = TransitionEffect.Checkerboard;
// Set the duration in seconds for the transition effect. Maximum duration value is 59 seconds
slide.SlideTransition.Duration = 40;
//Save the presentation
pptxDoc.Save("Transition.pptx");
//Close the presentation
pptxDoc.Close();
'Create a PowerPoint presentation
Dim pptxDoc As IPresentation = Presentation.Create()
'Add a blank slide to the presentation
Dim slide As ISlide = pptxDoc.Slides.Add(SlideLayoutType.Blank)
'Add a shape to the slide
Dim cubeShape As IShape = slide.Shapes.AddShape(AutoShapeType.Cube, 50, 200, 300, 300)
'Add a shape to the slide
slide.SlideTransition.TransitionEffect = TransitionEffect.Checkerboard
'Set the duration value(sec) for the transition effect. Max duration value is 59 seconds
slide.SlideTransition.Duration = 40
'Save the presentation
pptxDoc.Save("Transition.pptx")
'Close the presentation
pptxDoc.Close()

You can download a complete working sample from GitHub.

Set the transition delay

You can set the transition delay in seconds. This delays the next transactions to happen for a certain number of seconds. The following example demonstrates how to apply the time delay.

//Create a PowerPoint presentation
IPresentation pptxDoc = Presentation.Create();
//Add a blank slide to the presentation
ISlide slide = pptxDoc.Slides.Add(SlideLayoutType.Blank);
//Add a shape to the slide
IShape cubeShape = slide.Shapes.AddShape(AutoShapeType.Cube, 50, 200, 300, 300);
//Set the transition effect type
slide.SlideTransition.TransitionEffect = TransitionEffect.Checkerboard;
//Enable the transition time delay
slide.SlideTransition.TriggerOnTimeDelay = true;
//Assign the value for the advance time delay in seconds
slide.SlideTransition.TimeDelay = 5;
//Save the PowerPoint Presentation as stream
FileStream outputStream = new FileStream("Sample.pptx", FileMode.Create);
pptxDoc.Save(outputStream);
//Close the presentation
pptxDoc.Close();
//Create a PowerPoint presentation
IPresentation pptxDoc = Presentation.Create();
//Add a blank slide to the presentation
ISlide slide = pptxDoc.Slides.Add(SlideLayoutType.Blank);
//Add a shape to the slide
IShape cubeShape = slide.Shapes.AddShape(AutoShapeType.Cube, 50, 200, 300, 300);
//Set the transition effect type
slide.SlideTransition.TransitionEffect = TransitionEffect.Checkerboard;
//Enable the transition time delay
slide.SlideTransition.TriggerOnTimeDelay = true;
//Assign the value for the advance time delay in seconds
slide.SlideTransition.TimeDelay = 5;
//Save the presentation
pptxDoc.Save("Sample.pptx");
//Close the presentation
pptxDoc.Close();
'Create a PowerPoint presentation
Dim pptxDoc As IPresentation = Presentation.Create()
'Add a blank slide to the presentation
Dim slide As ISlide = pptxDoc.Slides.Add(SlideLayoutType.Blank)
'Add a shape to the slide
Dim cubeShape As IShape = slide.Shapes.AddShape(AutoShapeType.Cube, 50, 200, 300, 300)
'Set the transition effect type
slide.SlideTransition.TransitionEffect = TransitionEffect.Checkerboard
'Enable the transition time delay
slide.SlideTransition.TriggerOnTimeDelay = True
'Assign the value for the advance time delay in seconds
slide.SlideTransition.TimeDelay = 5
'Save the presentation
pptxDoc.Save("Sample.pptx")
'Close the presentation
pptxDoc.Close()

You can download a complete working sample from GitHub.

Set the trigger mode for the transition

The next slide transition can be triggered by the following two ways:

  1. Mouse clicks - Brings the next slide to the view.
  2. Setting a time - Brings the next slide after that specified time without any interactions.

Syncfusion PowerPoint library allows you to set both the previously given trigger modes while using PowerPoint slide transitions. Refer to the following code example.

//Create a PowerPoint presentation
IPresentation pptxDoc = Presentation.Create();
//Add a blank slide to the presentation
ISlide slide = pptxDoc.Slides.Add(SlideLayoutType.Blank);
//Add a shape to the slide
IShape cubeShape = slide.Shapes.AddShape(AutoShapeType.Cube, 50, 200, 300, 300);
//Set the transition effect type
slide.SlideTransition.TransitionEffect = TransitionEffect.Checkerboard;
//Set transition advance on click to true. This will enable the next transition after a click
slide.SlideTransition.TriggerOnClick = true;
//Save the PowerPoint Presentation as stream
FileStream outputStream = new FileStream("Sample.pptx", FileMode.Create);
pptxDoc.Save(outputStream);
//Close the presentation
pptxDoc.Close();
//Create a PowerPoint presentation
IPresentation pptxDoc = Presentation.Create();
//Add a blank slide to the presentation
ISlide slide = pptxDoc.Slides.Add(SlideLayoutType.Blank);
//Add a shape to the slide
IShape cubeShape = slide.Shapes.AddShape(AutoShapeType.Cube, 50, 200, 300, 300);
//Set the transition effect type
slide.SlideTransition.TransitionEffect = TransitionEffect.Checkerboard;
//Set transition advance on click to true. This will enable the next transition after a click
slide.SlideTransition.TriggerOnClick = true;
//Save the presentation
pptxDoc.Save("Sample.pptx");
//Close the presentation
pptxDoc.Close();
'Create a PowerPoint presentation
Dim pptxDoc As IPresentation = Presentation.Create()
'Add a blank slide to the presentation
Dim slide As ISlide = pptxDoc.Slides.Add(SlideLayoutType.Blank)
'Add a shape to the slide
Dim cubeShape As IShape = slide.Shapes.AddShape(AutoShapeType.Cube, 50, 200, 300, 300)
'Set the transition effect type
slide.SlideTransition.TransitionEffect = TransitionEffect.Checkerboard
'Set transition advance on click to true. This will enable the next transition after a click
slide.SlideTransition.TriggerOnClick = True
'Save the presentation
pptxDoc.Save("Sample.pptx")
'Close the presentation
pptxDoc.Close()

You can download a complete working sample from GitHub.

Set the speed for transition effect

The speed is the customized property provided by Syncfusion PowerPoint library to set the transition duration mentioned above (in this page) to a customized enumeration values. By default, each transition will happen for 2 seconds. You can change the following enumeration values to change the duration of a slide transition:

  1. Default - 2 seconds
  2. Fast - 0.5 seconds
  3. Slow - 1.0 seconds
  4. Medium - 0.75 seconds
//Create a PowerPoint presentation
IPresentation pptxDoc = Presentation.Create();
//Add a blank slide to the presentation
ISlide slide = pptxDoc.Slides.Add(SlideLayoutType.Blank);
//Add a shape to the slide
IShape cubeShape = slide.Shapes.AddShape(AutoShapeType.Cube, 50, 200, 300, 300);
//Set the transition effect type
slide.SlideTransition.TransitionEffect = TransitionEffect.Checkerboard;
//Set the transition effect speed enumeration. This will reduce the transition duration to 0.75 seconds from the default 2 second
slide.SlideTransition.Speed = TransitionSpeed.Medium;
//Save the PowerPoint Presentation as stream
FileStream outputStream = new FileStream("Sample.pptx", FileMode.Create);
pptxDoc.Save(outputStream);
//Create a PowerPoint presentation
IPresentation pptxDoc = Presentation.Create();
//Add a blank slide to the presentation
ISlide slide = pptxDoc.Slides.Add(SlideLayoutType.Blank);
//Add a shape to the slide
IShape cubeShape = slide.Shapes.AddShape(AutoShapeType.Cube, 50, 200, 300, 300);
//Set the transition effect type
slide.SlideTransition.TransitionEffect = TransitionEffect.Checkerboard;
//Set the transition effect speed enumeration. This will reduce the transition duration to 0.75 seconds from the default 2 second
slide.SlideTransition.Speed = TransitionSpeed.Medium;
//Save the presentation
pptxDoc.Save("Sample.pptx");
'Create a PowerPoint presentation
Dim pptxDoc As IPresentation = Presentation.Create()
'Add a blank slide to the presentation
Dim slide As ISlide = pptxDoc.Slides.Add(SlideLayoutType.Blank)
'Add a shape to the slide
Dim cubeShape As IShape = slide.Shapes.AddShape(AutoShapeType.Cube, 50, 200, 300, 300)
'Set the transition effect type
slide.SlideTransition.TransitionEffect = TransitionEffect.Checkerboard
'Set the transition effect speed enumeration. This will reduce the transition duration to 0.75 seconds from the default 2 seconds
slide.SlideTransition.Speed = TransitionSpeed.Medium
'Save the presentation
pptxDoc.Save("Sample.pptx")

You can download a complete working sample from GitHub.

Supported transition effect types:

The following are the list of transition effect options that can be applied to each transition effects.

S.No

Effects

Effect Options

1 Airplane
  • Left
  • Right
  • 2 Blinds
  • Horizontal
  • Vertical
  • 3 Box
  • Left
  • Right
  • Up
  • Down
  • 4 Checkerboard
  • Across
  • Down
  • 5 Circle None
    6 Comb
  • Horizontal
  • Vertical
  • 7 Conveyor
  • Left
  • Right
  • 8 Cover
  • Left
  • Right
  • Up
  • Down
  • LeftUp
  • LeftDown
  • RightUp
  • RightDown
  • 9 Crush None
    10 Cube
  • Left
  • Right
  • Up
  • Down
  • 11 Curtains None
    12 Cut
  • None
  • ThroughBlack
  • 13 Diamond None
    14 Dissolve None
    15 Doors
  • Horizontal
  • Vertical
  • 16 Drape
  • Left
  • Right
  • 17 FadeAway
  • Smoothly
  • ThroughBlack
  • 18 FallOver
  • Left
  • Right
  • 19 FerrisWheel
  • Left
  • Right
  • 20 Flashbulb None
    21 Flip
  • Left
  • Right
  • 22 FlyThrough
  • In
  • Out
  • InBounce
  • OutBounce
  • 23 Fracture None
    24 Gallery
  • Left
  • Right
  • 25 GlitterDiamond
  • Left
  • Right
  • Up
  • Down
  • 26 GlitterHexagon
  • Left
  • Right
  • Up
  • Down
  • 27 Honeycomb None
    28 Morph
  • ByObject
  • ByWord
  • ByChar
    29 Newsflash None
    30 Orbit
  • Left
  • Right
  • Up
  • Down
  • 31 Origami
  • Left
  • Right
  • 32 PageCurlDouble
  • Left
  • Right
  • 33 PageCurlSingle
  • Left
  • Right
  • 34 Pan
  • Left
  • Right
  • Up
  • Down
  • 35 PeelOff
  • Left
  • Right
  • 36 Plus None
    37 Prestige None
    38 Push
  • Left
  • Right
  • Up
  • Down
  • 39 Random None
    40 RandomBars
  • Horizontal
  • Vertical
  • 41 Reveal
  • SmoothLeft
  • SmoothRight
  • BlackLeft
  • BlackRight
  • 42 Ripple
  • Center
  • RightUp
  • RightDown
  • LeftUp
  • LeftDown
  • 43 Rotate
  • Left
  • Right
  • Up
  • Down
  • 44 Shred
  • StripsIn
  • StripsOut
  • RectangleIn
  • RectangleOut
  • 45 Split
  • HorizontalIn
  • HorizontalOut
  • VerticalIn
  • VerticalOut
  • 46 Strips
  • LeftDown
  • LeftUp
  • RightDown
  • RightUp
  • 47 Switch
  • Left
  • Right
  • 48 Uncover
  • Left
  • Right
  • Up
  • Down
  • LeftDown
  • LeftUp
  • RightDown
  • RightUp
  • 49 Vortex
  • Left
  • Right
  • Up
  • Down
  • 50 Warp
  • In
  • Out
  • 51 Wedge None
    52 Wheel
  • Spoke1
  • Spoke2
  • Spoke3
  • Spoke4
  • Spoke8
  • Reverse1Spoke
  • 53 Wind
  • Left
  • Right
  • 54 Window
  • Horizontal
  • Vertical
  • 55 Wipe
  • Left
  • Right
  • Up
  • Down
  • 56 Zoom
  • In
  • Out