Add and edit transitions in PowerPoint slides

3 Aug 202617 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 as simple as a Push transition that moves to the next slide, or as eye-catching as an Airplane transition that animates the next slide in. 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 effects have the following properties. These make slide transitions more flexible and interactive.

  1. Start (after a click or after a 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, 100, 100, 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
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, 100, 100, 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, 100, 100, 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.

//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
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 presentation
pptxDoc.Save("Transition.pptx");
//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)
'Set the transition effect type
slide.SlideTransition.TransitionEffect = TransitionEffect.Checkerboard
'Set the duration value (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()

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 transition by the specified 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 presentation
pptxDoc.Save("Sample.pptx");
//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 in the following two ways:

  1. On mouse click - Advances to the next slide when the user clicks.
  2. After a specified time - Advances to the next slide automatically after the specified time, without any user interaction.

The .NET 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 presentation
pptxDoc.Save("Sample.pptx");
//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 property is a predefined enumeration provided by the .NET PowerPoint Library that maps to a fixed transition duration (described in the Set the transition duration section above). By default, each transition lasts 2 seconds. You can assign any of 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 seconds
slide.SlideTransition.Speed = TransitionSpeed.Medium;
//Save the presentation
pptxDoc.Save("Sample.pptx");
//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 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");
//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 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")
'Close the presentation
pptxDoc.Close()

You can download a complete working sample from GitHub.

Supported transition effect types

The following table lists the transition effect options that can be applied to each transition effect.

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
  • Online Demo

    • Explore how to create slide transition effects in a PowerPoint presentation using the .NET PowerPoint Library (Presentation) in a live demo here.