PowerPoint 2010 - How to get CURRENT and TOTAL number of pages in the file to appear in the footer

Posted on 2016-11-17
Last Modified: 2016-11-21
I'd like to have my PowerPoint footer say:
Page (current page) of (total pages in file) so...
Page 1 of 20
Page 2 of 20
Page 3 of 20
How can I do this?
Question by:brothertruffle880
  • 2
  • 2
LVL 24

Accepted Solution

Echo_S earned 250 total points
ID: 41891977
Unfortunately you can't really do that in PPT. I suppose you can with code, but barring that, add a textbox that says Page <space space space> of 20  and in the <space space space> part, use Insert | Slide Number. This will update the current slide number, but not the total number of slides. You have to manually input the total number of slides.

This textbox on the master is different from a footer in that you cannot turn it on or off using Insert | Header and Footer. In this case, it's just always there.

To do this in the footer, your best bet is to put the "Page" and "of 20" parts in textboxes and then use the footer for the slide number because, while you used to be able to type the extra text into a footer, in more recent versions of PPT, that doesn't work.
LVL 10

Assisted Solution

by:Jamie Garroch
Jamie Garroch earned 250 total points
ID: 41891982
Echo is right (she always is!). You can automate the current slide number but not the total as per this Microsoft article:

If you want to do it by code, you could add a VBA macro but then you'd have to save the deck as a .pptm file unless you didn't need the code to travel with the file. If you're happy to use code, let me know and I'll write a macro for you.

Author Closing Comment

ID: 41894418
GREAT help from both of you.
LVL 24

Expert Comment

ID: 41894848
LOL, Jamie, you are so funny. I could say the same for you!

(Honestly, I'm just soooooo glad you code geeks are here to help people do the stuff I can't help them do manually!)
LVL 10

Expert Comment

by:Jamie Garroch
ID: 41895702
Geeks. lol. Can't live with 'em, can't live without 'em!

So, After playing with some code, I realised this slide number placeholder has some interesting behaviour. It doesn't appear possible to programmatically change the text to "Page <#> of <slidecount>" whilst maintaining the dynamic <#> reference. So the following macro is a hard overwrite and requires it to be run if the slide order or number of slides changes.

' PowerPoint VBA Macro to update slide number text in slides where this placeholder is visible.
' Written By : Jamie Garroch of YOUpresent Ltd.
' Date : 21NOV2016
' Notes : this replaces the dynamic ‹#› field in the slide master with fixed text
'         so if you delete, add, move slides, you'll need to run this macro again
'         to update the text in the slide number placeholder.
Sub SetFooterText()
  Dim oSld As Slide
  Dim oShp As Shape
  For Each oSld In ActivePresentation.Slides
    For Each oShp In oSld.Shapes
      If oShp.Type = msoPlaceholder Then
        If oShp.PlaceholderFormat.Type = ppPlaceholderSlideNumber Then
          oShp.TextFrame.TextRange.Text = "Page " & oSld.SlideIndex & " of " & ActivePresentation.Slides.Count
        End If
      End If
End Sub

Open in new window

The actual slide number has its own special properties but the only one accessible via the OM (Object Model) is the visible one e.g.

ActivePresentation.Slides(1).HeadersFooters.SlideNumber.Visible = msoFalse

Open in new window

Although IntelliSense indicates that this has a .Text property, it doesn't.

An alternative method to maintain the dynamic <#> field would be to leave that unchanged on the slide master and add two new text boxes either side of it so the one on the left contains "Page" and the one on the right contains "X" where X is the number of slides in your deck. You could then write a macro to update that value but since it's only in one place, it seems easier to just remember to do it manually.

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Outline From PowerPoint 2010 it is possible to have shapes appear in front of video, in earlier versions video always played in front of other shapes. This means it is possible to have captions animated to appear in front of video. Users who h…
PowerPoint is the go-to presentation software for millions of users around the world. Many presentations use basic text features but you can really make special text jump out of your slide by applying this bubble text design process. This article ha…
This video teaches viewers how to add simple and professional themes to their slides.
This video teaches viewers how to fit pictures into slides, crop and remove backgrounds, and alter photos to look more professional.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question