PowerPoint Macro: Changing All the Slide Show Settings to Slide Show Within a Window

This PowerPoint VBA macro changes the slide show setting to slide show within a window.

Macro Example

Sub SlideShowsWithinWindow()

  Dim prs As Presentation
 
  For Each prs In Presentations
    prs.SlideShowSettings.ShowType = ppShowTypeWindow
  Next prs

End With

Description

Variable Declaration

Sub...

  Dim prs As Presentation

The 3rd line declares an object variable named prs represents a Presentation object.

The Presentation object represents a single PowerPoint presentation.

obj-PowerPoint-Presentation

Starts Looping

Sub...

  Dim prs As Presentation

  For Each prs In Presentations

The 5th line starts to loop through all the elements (=Presentation) of a collection (=Presentations).

The Application.Presentations property returns the Presentations collection object.

obj-PowerPoint-Application-Presentations

The Presentations property is a member of the PowerPoint.Global class, so we can omit the Application property.

obj-PowerPoint-Global-Presentations

The Presentations is a collection of all the Presentation objects those are currently open in PowerPoint.

obj-PowerPoint-Presentations

Sets the Type of Slide Show

Sub SlideShowsWithinWindow()

  Dim prs As Presentation
 
  For Each prs In Presentations
    prs.SlideShowSettings.ShowType = ppShowTypeWindow

The 6th line sets the type of a slide show.

Presentation.SlideShowSettings

The Presentation.SlideShowSettings property returns a SlideShowSettings object that represents the slide show settings for the presentation.

obj-PowerPoint-Presentation-SlideShowSettings

SlideShowSettings.ShowType

The SlideShowSettings.ShowType property returns or sets the show type for the slide show.

obj-PowerPoint-SlideShowSettings-ShowType

In this case, we are setting to the ppShowTypeWindow that means a slide show with in a window.

After every presentation evaluated, this macro ends.

Sub SlideShowsWithinWindow()

  Dim prs As Presentation
 
  For Each prs In Presentations
    prs.SlideShowSettings.ShowType = ppShowTypeWindow
  Next prs

End With

Properties

http://www.relief.jp/itnote/archives/powerpoint-vba-slideshow-in-window.php

Apply to

  • PowerPoint 2013
  • PowerPoint 2010
  • PowerPoint 2007