Greetings,
I just started to write VB code for Powerpoint. The following code hides the
titles on all the slides.
Sub HideSlideTitles()
' Hides slide title by hiding the shape
Dim oSlide As Slide
For Each oSlide In ActiveWindow.Presentation.Slides
oSlide.Shapes.Title.Visible = msoFalse
Next oSlide
End Sub
The question is how do I skip the first slide which is the presentation
title page.
Any help or ideas are appreciated!
Thanks in advance!
Shyam Pillai - 07 Feb 2007 04:11 GMT
Ray,
Sub HideSlideTitles()
' Hides slide title by hiding the shape
Dim oSlide As Slide
For Each oSlide In ActiveWindow.Presentation.Slides
' Does the shape have a title?
If oSlide.Shapes.HasTitle Then
'If it is not a title slide then hide the title.
If oSlide.Layout <> ppLayoutTitle Then
oSlide.Shapes.Title.Visible = msoFalse
End If
End If
Next oSlide
End Sub

Signature
Regards,
Shyam Pillai
Animation Carbon
http://www.animationcarbon.com
> Greetings,
>
[quoted text clipped - 18 lines]
>
> Thanks in advance!
Ray Batig - 07 Feb 2007 23:39 GMT
Thank you and also the others that replied. Lots to learn!
Ray
> Ray,
>
[quoted text clipped - 37 lines]
>>
>> Thanks in advance!
Bill Dilworth - 07 Feb 2007 04:21 GMT
I would try something like this.
Sub HideUnwantedSlideTitles()
' Hides slide title placeholder on _
non-TitleMaster slides
Dim x As Integer
For x = 2 To ActivePresentation.Slides.Count
With ActivePresentation.Slides(x)
If .Layout <> ppLayoutBlank And _
.Layout <> ppLayoutTitle And _
.Layout <> ppLayoutTitleOnly Then
.Shapes.Title.Visible = msoFalse
End If
End With
Next x
End Sub

Signature
Bill Dilworth
A proud member of the Microsoft PPT MVP Team
Users helping fellow users.
http://billdilworth.mvps.org
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
vestprog2@ Please read the PowerPoint FAQ pages.
yahoo. They answer most of our questions.
com www.pptfaq.com
.
> Greetings,
>
[quoted text clipped - 18 lines]
>
> Thanks in advance!
John Wilson - 07 Feb 2007 08:10 GMT
Hi Bill
Shyam's code will do what you need if you want to not rempve the titles from
title layout slides (this is often slide 1, but not always)
There are errors in your code (corrected by Shyam) which I thought I would
point out in the interests of education! If you do not check that the slide
has a title
"If oSlide.Shapes.HasTitle Then " ....
any slide without a title will crash the code and can put the user into the
vb editor which is NOT a good idea! Bill checks this in a different way by
checking for blank layout (which doesn't have a title placeholder). Even with
Bill's check the code will crash if the title placeholder has been deleted
from another layout.
-- Improve your skills - http://www.technologytrish.co.uk/ppttipshome.html
email john AT technologytrish.co.uk
Need a dice throw for a ppt game?- http://www.technologytrish.co.uk/dice.html
> Greetings,
>
[quoted text clipped - 19 lines]
> Thanks in advance!
>