Results 1 to 6 of 6
  1. #1
    Lounger
    Join Date
    Feb 2001
    Location
    Glasgow, Scotland
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Total Number of Slides (Powerpoint 97)

    Is it possible to get the total number of slides to be on the sheet. So that you get 1 of 10 on the bottom of the sheet. Also is it possible to get this to then change to reflect the total number of slides if some of the total are hidden during a slide show. In the example if two were hidden, then the slides would show 1 of 8 on a slide show.

    Cheers

    Angus

  2. #2
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Total Number of Slides (Powerpoint 97)

    You can only do this manually by editing the slide master footer. There is no field/code for number of slides like there is in Word. You can get the total by using the File | Properties menu, Statistics tab. The only way to automate this is with a macro that you would have to run each time you change the total. Would you like a macro? --Sam
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  3. #3
    Lounger
    Join Date
    Feb 2001
    Location
    Glasgow, Scotland
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Total Number of Slides (Powerpoint 97)

    If you know how to put this in place, yes please. I have only dabbled in macros with excel.

    cheers

    Angus

  4. #4
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Total Number of Slides (Powerpoint 97)

    Well, like most PowerPoint macros, this one is a mess. Try it and see if it works. Let me know if you have problems. There are so many ways to put a presentation together that it is hard to foresee everything. If you really want to deal with hidden slides, then you would have to construct a totally different macro to number each slide individually because the <#> field also counts hidden slides. I have some ideas on hidden slides if you want to pursue it. HTH --Sam
    <pre>Option Explicit
    '
    Sub InsertPageTotal()
    Dim sld As Slide
    Dim s As Shape
    Dim rsp As Integer

    ' Check to make sure page numbering is done with masters
    rsp = vbNo ' Probably nothing to fix
    For Each sld In ActivePresentation.Slides
    If Not sld.DisplayMasterShapes Then
    If sld.HeadersFooters.SlideNumber.Visible = msoTrue Then
    rsp = MsgBox("Some of your slides do not use the slide master." _
    & vbCr & "These slides cannot be modified." _
    & vbCr & "Do you want me to correct this?" _
    , vbYesNoCancel + vbInformation)
    If rsp = vbCancel Then
    Exit Sub
    Else
    Exit For
    End If
    End If
    End If
    Next sld
    If rsp = vbYes Then
    For Each sld In ActivePresentation.Slides
    sld.DisplayMasterShapes = True
    sld.HeadersFooters.Clear
    Next sld
    End If
    With ActivePresentation
    fixMaster .SlideMaster, .Slides.Count
    If .HasTitleMaster Then
    fixMaster .TitleMaster, .Slides.Count
    End If
    End With
    End Sub
    '
    Sub fixMaster(m As Master, lngTotal As Long)
    Dim s As Shape
    '
    ' Find page number shape
    '
    For Each s In m.Shapes
    If s.Type = msoPlaceholder Then
    If s.PlaceholderFormat.Type = ppPlaceholderSlideNumber Then
    With s.TextFrame.TextRange
    .Delete ' Clear text
    .InsertSlideNumber
    .InsertAfter " of " & lngTotal
    End With
    End If
    End If
    Next s
    End Sub</pre>

    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  5. #5
    Lounger
    Join Date
    Feb 2001
    Location
    Glasgow, Scotland
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Total Number of Slides (Powerpoint 97)

    This works a treat. I think that I will ensure that the presentation has only the slides to be presented.

    Thanks for your help

    Angus <img src=/S/fanfare.gif border=0 alt=fanfare width=31 height=23>

  6. #6
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: Total Number of Slides (Powerpoint 97)

    Sammy,

    Looks good and the originator seems happy. I didn't even know about the Hidden slide feature - that's a new one on me. Probably will find an occasional use for it. I just move slides I don't want after a slide labeled "Backup" or just delete them.

    Even tho not wanted, it seems there may be a quick way to find if a slide is hidden. I created a trivial 3-slide show and went into slide sorter view. I recorded a macro of selecting slides and then hiding them and unhiding them kind of in random fashion (a special "hidden" icon comes up under the slide). These are the statements I got:
    ActivePresentation.Slides.Range(Array(1)).Select
    ActiveWindow.Selection.SlideRange.SlideShowTransit ion.Hidden = msoTrue
    ActivePresentation.Slides.Range(Array(2)).Select
    ActiveWindow.Selection.SlideRange.SlideShowTransit ion.Hidden = msoTrue
    ActivePresentation.Slides.Range(Array(1)).Select
    ActiveWindow.Selection.SlideRange.SlideShowTransit ion.Hidden = msoFalse
    ActivePresentation.Slides.Range(Array(3)).Select
    ActiveWindow.Selection.SlideRange.SlideShowTransit ion.Hidden = msoTrue
    ActivePresentation.Slides.Range(Array(2)).Select
    ActiveWindow.Selection.SlideRange.SlideShowTransit ion.Hidden = msoFalse
    So I would imagine that one could loop thru all the slides in a show (using Activepresentation.Slides.Count for the range of the loop), test the hidden property, and subtract off the total hidden from the total slides. This way, you don't even need the property. I guess you'd still do all the checking you have in your macro.

    What would be of equal or more use, IMHO, would be to get a count of slides in a custom slide show. Would your macro work for that? Don't write any code since I'm not sure I'd ever need any of this. Just idle curiosity.

    Fred

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •