Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General PowerPoint Questions / March 2008

Tip: Looking for answers? Try searching our database.

Slide numbers without hidden slides

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JoAnn - 25 Mar 2008 14:40 GMT
I'm having trouble getting the displayed slide numbers in my presentation to
skip hidden slides. Using Office 2003 with an XP system.

I added John Wilson's code found in this site but it still doesn't work. Not
sure what I'm doing wrong.

Here is the code being used:

Sub numbers()
Dim osld As Slide
Dim i As Integer
For Each osld In ActivePresentation.Slides
If osld.SlideShowTransition.Hidden = False Then
i = i + 1
osld.HeadersFooters.Footer.Text = "Slide " & i
Else
osld.HeadersFooters.Footer.Text = "Slide " & i & "H"
End If
Next

With the footer set to show slide numbers, I get the original numbers
including the hidden slides.  When I clear that box (since the code seems to
be displaying "slide" plus the number), I get nothing.  

We do have something else in the footer (corporate stuff I'm not allowed to
remove) & it's possible that the slide number is hidden below it.

Is there any code that can be added to ensure the slide number appears in
the lower left corner of the footer, on top of anything else?

Also, once this is set will it stick? And adjust when other slides are
hidden or made visible?  Do I need some kind of code to ensure it runs
automatically every time the presentation is opened?

Thanks for your help!  
Signature

JoAnn

John Wilson - 25 Mar 2008 19:02 GMT
Try this code then. It will not run automatically when you eg add or hide
slides but it will remove "old" numbers and re number the non hidden slides
and can be run whenever you change the presentation

Sub hiddennums()
Dim osld As Slide
Dim i As Integer
Dim otxtbox As Shape
'Remove old numbers
For Each osld In ActivePresentation.Slides
For i = osld.Shapes.Count To 1 Step -1
If osld.Shapes(i).Tags("Number") = "yep" Then _
osld.Shapes(i).Delete
Next i
Next osld
'Number non hidden slides only
For Each osld In ActivePresentation.Slides
If osld.SlideShowTransition.Hidden = False Then
i = i + 1
Set otxtbox = osld.Shapes.AddTextbox(msoTextOrientationHorizontal, 10, 500,
20, 20)
With otxtbox
.TextFrame.TextRange = CStr(i)
.Tags.Add "Number", "yep"
End With
End If
Next osld
set otxtbox = Nothing
End Sub

To make this run as you want completely automatically is possible but it
would reaally be best as an add in and you would need to understand events in
vba code
Signature

Amazing PPT Hints, Tips and Tutorials

http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk

> I'm having trouble getting the displayed slide numbers in my presentation to
> skip hidden slides. Using Office 2003 with an XP system.
[quoted text clipped - 31 lines]
>
> Thanks for your help!  
JoAnn - 25 Mar 2008 19:23 GMT
Thanks ... that works!

Is there anyway I can control the font color & size ? What would I need to
add & where?

Signature

JoAnn

> Try this code then. It will not run automatically when you eg add or hide
> slides but it will remove "old" numbers and re number the non hidden slides
[quoted text clipped - 65 lines]
> >
> > Thanks for your help!  
John Wilson - 25 Mar 2008 19:32 GMT
Sub hiddennums()
Dim osld As Slide
Dim oshp As Shape
Dim i As Integer
Dim otxtbox As Shape
'Remove old numbers
For Each osld In ActivePresentation.Slides
For i = osld.Shapes.Count To 1 Step -1
If osld.Shapes(i).Tags("Number") = "yep" Then _
osld.Shapes(i).Delete
Next i
Next osld
'Number non hidden slides only
For Each osld In ActivePresentation.Slides
If osld.SlideShowTransition.Hidden = False Then
i = i + 1
Set otxtbox = osld.Shapes.AddTextbox(msoTextOrientationHorizontal, 10, 500,
20, 20)
With otxtbox.TextFrame.TextRange
.Text = CStr(i)
'change values to suit
.Font.Color.RGB = RGB(100, 20, 20)
.Font.Size = 10
.Font.Name = "Arial"
End With
otxtbox.Tags.Add "Number", "yep"
End If
Next osld
End Sub
Signature

Amazing PPT Hints, Tips and Tutorials

http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk

> Thanks ... that works!
>
[quoted text clipped - 70 lines]
> > >
> > > Thanks for your help!  
JoAnn - 25 Mar 2008 19:42 GMT
Perfect!!! Thank you very much!
Signature

JoAnn

> Sub hiddennums()
> Dim osld As Slide
[quoted text clipped - 100 lines]
> > > >
> > > > Thanks for your help!  

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.