Solved

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

Posted on 2016-11-17
5
67 Views
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?
0
Comment
Question by:brothertruffle880
  • 2
  • 2
5 Comments
 
LVL 24

Accepted Solution

by:
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.
0
 
LVL 9

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:

https://support.office.com/en-gb/article/Show-the-slide-number-and-total-number-of-slides-on-every-slide-e62b363a-a5c4-413e-b7b7-52c1a4d9dd02

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.
1
 

Author Closing Comment

by:brothertruffle880
ID: 41894418
GREAT help from both of you.
Thanks!
0
 
LVL 24

Expert Comment

by:Echo_S
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!)
1
 
LVL 9

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. http://youpresent.co.uk/
' 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
    Next
  Next
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.
1

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article describes how to make a simple, pseudo-random number generator in Microsoft PowerPoint. The code checks the generated numbers against a list of numbers already generated to prevent duplication. We used this as a youth group activity but…
Background   Certain code in VBA requires initialization, such as application events. The app initialization is often triggered by the Auto_Open sub which is a special procedure that runs when an add-in loads. More significantly, this sub does n…
This video teaches viewers how to fit pictures into slides, crop and remove backgrounds, and alter photos to look more professional.
The viewer will learn how to edit animations within the presentation, incorporate sound, and set everything up with timing.

706 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now