Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


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

Posted on 2016-11-17
Medium Priority
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 1000 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 1000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article shows how to simulate drawing numbers or names from a hat or bag using vba in PowerPoint and prevents duplicate items being selected. It’s not difficult to choose a (semi) random number in vba. The RND function returns a decimal numb…
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…
The viewer will learn how to edit animations within the presentation, incorporate sound, and set everything up with timing.
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: …

688 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