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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 25

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 12

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 25

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 12

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

People often ask "How do I make this macro run every time I show a new slide or add a new slide etc." This means making PowerPoint respond to that EVENT and, unlike in Excel, it's not that easy! First, I would avoid using the pseudo events left o…
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
The viewer will learn how to edit the master slide. They will also learn how to combine multiple themes into one master slide to use them in their presentation.
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …

729 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