Creating a Summary Slide with a Macro in PowerPoint 2007
Microsoft Powerpoint, Tips & Tricks Add comments
Previous versions of PowerPoint come with a Summary Slide feature that creates a slide titled “Summary Slide” at the end of the presentation, and, for each selected slide, it includes a bullet with the slide title. It is a handy and easy method for creating a bare-bones summary of your presentation.
Alas, that feature is not included in PowerPoint 2007. Not to worry, though, because the VBA procedure shown in Listing 1 performs the same function. Before running this proÂcedure, use the Navigation pane or Slide Sorter view to select the slides that you want to include in the summary.
Listing 1 A VBA Procedure that Creates a Summary Slide from the Titles of the Selected Slides


The procedure begins with a For Each…Next loop that runs through the selected slides in the active window. A second For Each…Next loop runs through the shapes in the current slide. For each shape, the procedure tests the HasTextFrame property: If it returns True, then the shape’s text is stored in the strSlideTitle variable. Some slide titles include multiÂline text, and some slides don’t have titles at all, but just bullets, which are also multiline text. In both cases, we want the summary to show just the first line of the text. To strip out everything else, the code looks for the vertical tab character (ASCII 11), which is what PowerPoint uses to create separate lines of text. After that’s done, we have the text we want for the summary, so the code exits the second For Each…Next loop. Just in case you come across a slide that has no text (you should exclude such slides from your selection), the code checks to see if strSlideTitle is still empty. If so, the code just sets it to the name of the slide.
Now that we have the summary text, the code adds a new Title and Content slide to the end of the presentation, sets the Title placeholder text to Summary, and sets the Content placeholder text to the summary string. Figure 1 shows an example of a summary slide this procedure creates.

Figure 1 A summary page created by the VBA procedure shown in this section.
[tag]summary slide, macro, powerpoint 2007[/tags]
Popularity: 2% [?]








Recent Comments