Automatically Create Summary Slides in PowerPoint 2010 for Free!

*UPDATE* Please see part two of this blog post for an updated version that creates a auto summary slides for PowerPoint 2010 with hyperlinks!

Download the Create Summary Slide Macro PowerPoint 2010 slide deck here.

Not strictly SharePoint Architect related, but I cooked this VBA script up whilst working on my latest SharePoint 2010 Developer courseware.

In PowerPoint 2003 and earlier there was a button you could press that would automagically create a Summary Slide or Table of Contents Slide for you based upon slides you’d selected in Slide Sorter.

It got taken away in PowerPoint 2007, and it’s still missing in 2010! So tonight I wrote this macro. Apologies for any errors. It’s very, very late.

Creative Commons Zero - CC0

   1: '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

   2: ''' InsertSummary()

   3: ''' by Joel Jeffery (http://joelblogs.co.uk) August 2010

   4: ''' Creates a Summary Slide for PowerPoint 2010

   5: ''' (and probably 2007 too!)

   6: ''' Depends: Requires QSortInPlace by Chip Pearson

   7: ''' Usage: Select Slides (e.g. in Slide Sorter) and run

   8: ''' this macro.

   9: ''' License: Creative Commons Public Domain 2010

  10: '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

  11: Sub InsertSummary()

  12:     Dim i As Integer

  13:     Dim strSel As String, strTitle As String

  14:     Dim summary As Slide

  15:

  16:     'Only run if we've got something selected

  17:     If ActiveWindow.Selection.SlideRange.Count > 0 Then

  18:         'Array to hold the order of the slides...

  19:         'We do this or we build the ToC in the order

  20:         'in which the slides were selected :)

  21:         Dim slideOrder() As Integer

  22:

  23:         'Size this to the number of slides selected

  24:         ReDim slideOrder(1 To ActiveWindow.Selection.SlideRange.Count)

  25:

  26:         'Collect all the IDs of the selected slides

  27:         For i = 1 To ActiveWindow.Selection.SlideRange.Count

  28:             slideOrder(i) = ActiveWindow.Selection.SlideRange(i).SlideIndex

  29:         Next

  30:

  31:         'Sort them with the QSort Algorithm

  32:         'By Chip Pearson, www.cpearson.com, [email protected]

  33:         QSortInPlace slideOrder

  34:

  35:         'Iterate over the slides in Index order

  36:         For o = 1 To UBound(slideOrder)

  37:             If ActivePresentation.Slides(slideOrder(o)).Shapes.HasTitle Then

  38:                 'Build up the ToC Text

  39:                 strTitle = ActivePresentation.Slides(slideOrder(o)).Shapes.Title.TextFrame.TextRange.Text

  40:                 strSel = strSel & strTitle & vbCrLf

  41:             End If

  42:         Next

  43:

  44:         'Create the summary slide before the first slide in the selection

  45:         Set summary = ActivePresentation.Slides.Add(slideOrder(1), ppLayoutText)

  46:         'Add the title

  47:         summary.Shapes(1).TextFrame.TextRange = "Module Summary"

  48:         'Add the ToC text

  49:         summary.Shapes(2).TextFrame.TextRange = strSel

  50:     End If

  51: End Sub

  52:

To the extent possible under law, Joel Jeffery has waived all copyright and related or neighbouring rights to InsertSummary() Macro for PowerPoint 2010. This work is published from United Kingdom. Why am I bothering to licensed this under Creative Commons? Because some folks are selling similar functionality as a PowerPoint Add-In and I think it should be free. Enjoy!

You’ll also need the QSortInPlace method by Chip Pearson.

To use, simply select all the slides you want to use for your summary (for instance, in Slide Sorter view) and run the InsertSummary() macro.

PowerPoint 2010 Slide Sorter

Here’s the result:

PowerPoint Automatic Summary Page

One bullet point bearing the title of each slide you include.

Enjoy!

Comments

    • says

      Mmmm. I like a challenge…
      If I add the following code to the InsertSummary() macro:

      ' By popular demand...! ;)
      If CreateHyperlinks Then
      'Add Hyperlinks :)
      For o = 1 To UBound(slideOrder)
      If ActivePresentation.Slides(slideOrder(o) + 1).Shapes.HasTitle Then
      'Build up the ToC Text
      strTitle = ActivePresentation.Slides(slideOrder(o) + 1).Shapes.Title.TextFrame.TextRange.Text
      With summary.Shapes(2).TextFrame.TextRange.Paragraphs(o).ActionSettings(ppMouseClick)
      .Action = ppActionHyperlink
      .Hyperlink.Address = ""
      .Hyperlink.SubAddress = ActivePresentation.Slides(slideOrder(o) + 1).SlideID & "," & ActivePresentation.Slides(slideOrder(o) + 1).SlideIndex & "," + strTitle
      End With
      End If
      Next
      End If

      And change the method signature of the macro to:

      Sub InsertSummary(Optional CreateHyperlinks As Boolean)

      …then yes: It now supports hyper links.

      To make it easy to add this macro to the UI, you would also need to add this subroutine:

      Sub InsertSummaryWithHyperlinks()
      InsertSummary CreateHyperlinks:=True
      End Sub

      Now we can add both InsertSummary() and InsertSummaryWithHyperlinks() to our PowerPoint Quick Access Toolbar!

      I will post a follow up article with the full source attached asap.

      Thanks for the idea! :o)

  1. Margaux says

    For us non-tech folks, how do i make QSortInPlace method by Chip Pearson work? I went to his site and it was all Greek to me. Is it another Macro or something more?

    • says

      Hi Margaux!

      Welcome to my blog! Thanks for finding me!

      Chip Pearon’s “QSortInPlace” is indeed a VBA macro. If you’re non-technical, I’d recommend not putting all the pieces together yourself. Instead, you can download the completed deck here: Joel’s Create Summary Slide Macro PowerPoint 2010 Slide Deck. Let me know if it’s not working for you, and I can walk you through it.

      Joel

      • Annette says

        Hi Joel,
        the link isn’t working anymore. Is there a possibility to download the code somewhere else?

        Thank you in advanced.

        BR Annette

  2. Ben Story says

    Joel,
    I understand Visual Basic at a middle school level. Most of my experience is in excel and access. I want to create buttons that (upon click) will pop up different slides. I can not find how to define slides seperately. Could you help me with this? I am available today for a quick phone call if need be.

    Thanks, Ben

    • says

      Hi Ben!

      Thanks for visiting!

      You can probably do this without any coding at all :)

      If you want a shape to act as a button and take you to a slide of your choice, you can always:

      1. Start PowerPoint and go to Insert -> Shapes and add a suitable shape or rectangle to your slide
      2. Edit the shape to look visually appealing :)
      3. Select the shape in PowerPoint
      4. Go to Insert->Action
      5. Pick ‘Hyperlink to:’
      6. Select ‘Slide…’ from the drop down list
      7. Pick the slide to which you’d like to link

      How about that?

      Let me know how you get on.

      joel

  3. Marshall says

    Joel;
    This is a simple solution to address that missing functionality – thanks for your late-night work :)
    You seem to understand the hyperlinks process – whenever I embed a hyperlink (either text or image) to another slide within the same document and I click on the link powerpoint wants to open another copy of the current document. How do I get the behavior similar to a Word bookmark?

    Thanks

  4. Mark Allen says

    Your program is really amazing…what a time saver. Thank you. But can I also link the page numbers from the slides into my table of contents?
    When I move the slides around, which I do because it is a “living” document, I want to have the TOC capture those movements and update the page numbers right along with me.
    Possible?

  5. Antoine Martin says

    Many thanks. The TOC is not perfect, but it’s already much better than nothing.
    Thanks again!

  6. Kurt says

    it does not work for me. The macro just creates a page with the title “Module Summary” and an empty text box – and thats it.

    oh well – I can do it manually.

    • says

      Hi Kurt!

      Thanks for the feedback. Could you let me know which version of PowerPoint you’re using, or let me know if you’re happy to send me a PowerPoint deck that didn’t work for you, and I can try to investigate?

      Thanks,

      joel

  7. Jay says

    Thanks so much for this great solution. I added a quick piece of code to put in page numbers. I added 1 to the slide number to account for the new TOC slide, so there may be cases where this may be off for you depending on how your deck is numbered. The new code is the two lines above the End If statement below.

    ‘Iterate over the slides in Index order
    For o = 1 To UBound(slideOrder)
    If ActivePresentation.Slides(slideOrder(o)).Shapes.HasTitle Then
    ‘Build up the ToC Text
    strTitle = ActivePresentation.Slides(slideOrder(o)).Shapes.Title.TextFrame.TextRange.Text
    intSlideNumber = ActivePresentation.Slides(slideOrder(o)).SlideNumber
    strSel = strSel & strTitle & “……….” & intSlideNumber + 1 & vbCrLf
    End If
    Next

    • says

      Hi Jay!

      Thanks for the comment!

      I’ll have a look at your algorithm and see if I can include it in the next version of the slide deck.

      Best wishes,

      joel

    • Serena says

      Hi Jay,
      I am looking for a TOC with page numbers which will update automatically if I shift the slides. I think this is what your algorithm is about.
      @Joel: As I have no idea of VBA and the like, could you please add that in a new version as a download like the previous macro? Or at least walk me through, where I have to add Jay’s algorithm. Thanks!

  8. says

    Hi Joel,
    Thanks for this solution. I would like to know if we can export to PDF and generate bookmarks (for the PDF reader) with the hyperlinks (generated by your VB macro). It would be very great if we can do such things.
    Best regards, Martin

    • says

      Hi Martin,

      Thanks for posting!

      If you go File -> Save As and pick PDF format, PowerPoint will export you a PDF that preserves the bookmark hyperlinks.

      How cool is that?

      joel

  9. says

    Here is a way to create a summary page (or table of contents) in PowerPoint using VBA without underlining.

    ”””””””””””””””””””””””””””””’
    ”’ InsertTOCPage(Optional CreateHyperlinks As Boolean)
    ”’ by Charles Morrison June 2011
    ”’ from a script by Joel Jeffery (http://joelblogs.co.uk)
    ”’ Creates a TOC Slide for PowerPoint 2010
    ”’ (and probably 2007 too!)
    ”’ Depends: Requires QSortInPlace by Chip Pearson
    ”’ Usage: Select Slides (e.g. in Slide Sorter) and run
    ”’ this macro.
    ”’ License: Creative Commons Public Domain 2010
    ”””””””””””””””””””””””””””””’
    Sub CreateTOCPage(Optional CreateHyperlinks As Boolean)
    Dim i As Integer
    Dim TOC As Slide
    Dim strTOC_arr(1 To 51) As String

    ‘Only run if we’ve got something selected
    If ActiveWindow.Selection.SlideRange.Count > 0 Then
    ‘Array to hold the order of the slides…
    ‘We do this or we build the ToC in the order
    ‘in which the slides were selected :)
    Dim slideOrder() As Integer

    ‘Size this to the number of slides selected.
    ReDim slideOrder(1 To ActiveWindow.Selection.SlideRange.Count) ‘ zero is not the count of a slide and a slide will be inserted which throws off the count.

    ‘Collect all the page numbers of the selected slides into the slideOrder array
    For i = 1 To ActiveWindow.Selection.SlideRange.Count
    slideOrder(i) = ActiveWindow.Selection.SlideRange(i).SlideIndex
    Next

    ‘Sort them with the QSort Algorithm
    ‘By Chip Pearson, http://www.cpearson.com, [email protected]
    QSortInPlace slideOrder

    ‘ get titles before the TOC slide is inserted, otherwise the number and title of the slide gets captured as part of the arrays.
    ‘ but also then must add 1 to the page number.
    ‘Fill the strTOC_arr array with the titles for the selected slides.
    ‘ a trouble here is that the content page is selected also.
    For i = 1 To UBound(slideOrder)
    If ActivePresentation.Slides(slideOrder(i)).Shapes.HasTitle Then
    ‘Populate the array containing the ToC Text
    strTitle = ActivePresentation.Slides(slideOrder(i)).Shapes.Title.TextFrame.TextRange.Text
    strTOC_arr(i) = strTitle & ” . . . . . . . . . . . . . . . . . . . . ” & slideOrder(i) + 1 & vbCrLf ‘ <<=== here we add a one to the page number to make up for inserting the TOC slide.
    End If
    Next

    'Create the TOC slide and title before the first slide in the selection
    ' Create this page first so that subsequent slides will be numbered correctly and this page's tilte is not captured.
    Set TOC = ActivePresentation.Slides.Add(2, ppLayoutText) ' Make the TOC the second slide
    'Add the title to the TOC page.
    TOC.Shapes(1).TextFrame.TextRange = "Contents" 'shape 1 is the default caption in all PowerPoint slides
    TOC.Shapes(1).TextFrame.TextRange.Font.Size = 30

    ' On the TOC page, delete the default text box with bullets. If you like bullets, comment this out.
    TOC.Shapes.Item(2).Delete

    ' start making new text boxes, and adding a hyperlink to the box rather than the text
    ' this makes hyperlinks without underlining.
    If CreateHyperlinks Then
    'Loop through the array of slides with titles
    For i = 1 To UBound(slideOrder)
    If ActivePresentation.Slides(slideOrder(i)).Shapes.HasTitle Then
    'make the textboxes Left, top, width, height
    TOC.Shapes.AddTextbox msoTextOrientationHorizontal, 20, 80 + (30 * i), 750, 20 '80 = reasonable starting point down the page.
    ' add text
    TOC.Shapes(i + 1).TextFrame.TextRange = strTOC_arr(i) ' this will also start at 2 since the array is dimensioned that way.
    ' add hyperlink to text box
    TOC.Shapes(i + 1).ActionSettings(ppMouseClick).Hyperlink.Address = ""
    TOC.Shapes(i + 1).ActionSettings(ppMouseClick).Hyperlink.SubAddress = ActivePresentation.Slides(slideOrder(i) + 1).SlideID & "," & ActivePresentation.Slides(slideOrder(i) + 1).SlideIndex & "," + strTOC_arr(i)
    ' Format the text
    TOC.Shapes(i + 1).TextFrame.TextRange.Paragraphs.Font.Bold = msoFalse
    TOC.Shapes(i + 1).TextFrame.TextRange.Paragraphs.Font.Size = 20
    TOC.Shapes(i + 1).TextFrame.TextRange.Paragraphs.Font.Color.RGB = RGB(0, 0, 0)

    ' If for some reason you want underlined blue hyperlinks
    'TOC.Shapes(i + 1).TextFrame.TextRange.Paragraphs.Font.Color.RGB = RGB(0, 0, 255)
    'TOC.Shapes(i + 1).TextFrame.TextRange.Paragraphs.Font.Underline = msoTrue

    'other options
    'TOC.Shapes(i + 1).TextFrame.TextRange.Paragraphs.Font.Italic = msoTrue
    'TOC.Shapes(i + 1).TextFrame.TextRange.Paragraphs.Font.Shadow = msoTrue
    End If
    Next
    End If

    End If
    End Sub

    Sub InsertTOC()
    CreateTOCPage CreateHyperlinks:=False
    End Sub

    Sub InsertTOCWithHyperlinks()
    CreateTOCPage CreateHyperlinks:=True
    End Sub

      • Raegon says

        I really like what Charles posted where it doesn’t do the underlined hyperlinks; however, it didn’t work on my file where your underlined version did. Did you test Charles version? Would love to have a working version of ‘without underlined hyperlinks’…

  10. Karen says

    OMG, I’m just about at the end of my rope. I’ve got this huge (80-pg) powerpoint presentation (yah, 80 pages) that my boss wants to use to train people on our software. However, without a TOC feature in PowerPoint 2010, I’m totally lost. How can a VBA illiterate person such as myself take advantage of what I’m guessing is a totally cool trick you’ve shared here???
    Please…I’ll be eternally grateful if you can help me out!

  11. Rudolf says

    Hello

    my ppt is about 120 page.

    first:
    With your macro i get one slide – and i must make additional slides and copy the contents to this slides to get all the text on.

    second:
    I also need the page number of the slides. For example:

    1 composite Materials 1
    1.1 carbon fibre 2

    I found a german page with a very strong addin – but this will not work on ppt 2007/2010. (www.pptrick.de)

  12. Thomas says

    I’m trying to write code that will take the section titles of each section in a powerpoint presentation and create a text box at the top of each page with the text being the name of the section each slide exists in. I can get all the section titles using the SectionProperties object but I can’t figure out how to properly loop through all the slides and insert the text box with the name of section on each slide. Any help would be greatly appreciated.

    Thomas

  13. Rehan Sarang says

    Hi Joel, thanks for the code. I have been searching for sumthing similar and you saved my life. However what i was looking at is to create title slides from summary slide with links. And these should be on all slides. sumthing like breadcrumbs we have in webiste. Any help on this will be highly appreciated. Im trying to automate a process we have in our company.

  14. says

    Hey Joel – thanks so much for the deck with summary code built in, really appreciated. Any feel when you’d be making available a version that also add slide numbers to the summary? Love your work, all the best Jac’

  15. Bill says

    Joel,
    Love your singing. Is there a way to create a slide share webpart in SharePoint which allows viewing without opening the presentation? Is a SlideShare, YouTube or a similar plug-in available for SharePoint?
    V/R
    Bill in Virginia

  16. says

    Hi. Thanks for the macro.
    It is possible to change it like this:
    a) bullet level 1 are sections of the presentation
    b) bullet level 2 are the hyperlinked slides of the section
    c) add the summary at the end (my use is: I start the presentation [F5] and once I come to the end and questions are asked, I press [End] so that I can navigate to slides easily. Putting them at first position “destroys” my title page.)
    It was not much work to achieve this manually, though.

    BTW: why did you need sorting? I just removed the sorting and everything was ok as well.

    Thanks.

  17. Pierre says

    Great piece of work ! alas I am completely unable to get it to work in all my presentations. Eg I would like to have the scripts available in all my presentations as a standard. How can i do this ? Your explanations in the pptm itself are not enough for the d… boy i am
    Thanks

  18. Kari says

    I inserted your macro into my toolbar; however, when I click on it, I get a message stating, “The macro cannot be found or has been disabled because of your security settings.” I have enabled all macros, and I have enabled Developer Macro settings. What else should I try?

  19. Susan says

    Hi, I added this macro and working no problem, using the non-underlined text and the page numbering. Would it be possible to insert a table and add the page titles to the left column and the numbers to the right? I’ve had a go, and I can’t see beyond adding a table of the correct number of rows and columns! Thanks anyway for the neat macro.

  20. Ramon says

    Hi!!, congratulations for developing this macro. I’ve just run it and worked quite well in Power Point 2007.

    I was wondering how difficult could it be to add a slide number on the right of the slide id?.

    Regards from Mexico

  21. Felix says

    Thanks for the Macro!

    I would like to echo the other comments about adding the slide numbers.

    Also, possibly being able to change the in the macro.

    Thanks again!

  22. Tilo says

    That slide summary automatism is brilliant! So much time wasted because MS decided to NOT include this feature any more. Thanks for that.

  23. Daniela says

    Hi,

    thanks for the macro.

    But I have a problem. It doesn’t work when i’m using a presentation-template. Do I have to configure anything in the master-view?

    Many Thanks.

  24. says

    Thank you very much for sharing your code. Having a summary slides for lengthy is very important.

    We also have a similar thing, a commercial add-in called PowerTOC, that also creates automatic summary slides. It is not free but it does offers a more complete and a larger range solutions. If you are interested, we would love to give you a review code.

    Yours Sincerely,
    Gonzalo Oñate

  25. roshan says

    Hi Joel,
    The macro code for InsertSummaryHyperlink is fantastic,it works great..Kudos and this Macro rocks forever, however the table of contents with hyperlink helps to link to any number of Slides
    I would like to know, whether there are any automation with macro or functionality where I can go to the last slide using InsertSummaryHyperlink code and again go back to the first slide with a single hyperlink click ?
    Waiting for your earnest reply..

    Merry Christmas and Advance Happy New Year..:-)

  26. roshan says

    Hi Joel / Team ,
    To make it simple about my query, I want to know is there any solution for the to insert any image or text hyperlink which will lead us to the index or table of contents slide from the any number of slides inserted in the powerpoint using the QuickSortInPlace algorithm macro code…hope there is a solution for this query too…?

  27. Geoff says

    G’day,

    Exactly what I was looking for, to create a summary slide. And so elegantly done too!

    I will use this technique for keeping my Macro’s in one place – brilliant.

    Thanks,
    Geoff

  28. rahul says

    Hi,
    Thanks for the Code it works fine, however if I have more than 50 slides with title names and run the macro the table of contents slide cannot hold the 50 names in singlie column of the slide, are there any advanced version of this code where the Title names in the table of conetents slide will be splited in to three columns ?

  29. Deborah says

    I downloaded the macro which works fablously in PowerPoint 2007. Thank you for sharing and answering the many questions we all have sent you. I have another question that is more like a request to possibly enhance the macro to include the slide page numbers. So to that end, would it be possible to include the slide page numbers too in the macro? We use PowerPoint to deliver some of our training and it would be nice to have the page numbers so users know where to go in the guide.

  30. says

    Thank you for this! I just wrote an article about it and how to use it in Norwegian on my website.

    It works well as is, but it would be an advantage to have the slide-numbers all aligned nicely to the right.

  31. Albert says

    OMG!!! So much trouble and only because of the choice of the wrong tool :)
    I have managed recently to prepare my last presentation using Beamer LaTeX document class for the first time (http://en.wikipedia.org/wiki/Beamer_%28LaTeX%29). Very powerful, although I should warn you the learning curve is steep if you never used LaTeX.
    Just for the case somebody looks for an alternative approach…

    Merry Christmas and Happy New Year!

  32. says

    Hi Joel
    I came across you blog while doing some research to train a client upgrading to Office 2013!
    I wonder if they have put summary slide back in ? I thought to myself and tried to google it and whoosh – you have answered my prayers.
    I so missed that feature – you are a clever bunny and I want to send you flowers or chocolates or a fruit basket (not that they do these in the UK but I have seen friends get them in the US and they look amazing!).
    I think I maybe a little bit drunk with the excitement :-)
    Thank you sooooooo much xxxxx

  33. Preethi says

    Hi Joel,

    I would like the Contents list in a table format. I tried modifying your code as follows:

    ‘Create the summary slide before the first slide in the selection
    Set summary = ActivePresentation.Slides.Add(slideOrder(1), ppLayoutTitleOnly)
    ‘Add the title
    summary.Shapes(1).TextFrame.TextRange = “Step-by-Step Procedure”
    ‘Add the ToC text
    summary.Shapes.AddTable(6, 1, 78, 126)

    And I get an error at the last line as below:

    Compile error:

    Expected: =

    How do I solve this? Or if it’s simpler, how do I modify your code to get the output in a table format?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>