PC Review


Reply
Thread Tools Rate Thread

Displaying 'Next' & 'Previous' Slide Titles In Captions/Textboxes/Labels

 
 
ryan.crowe@gmail.com
Guest
Posts: n/a
 
      20th Jun 2006
Hi All-
Good group here. I've found alot of useful stuff on it but I was
having trouble figuring this out:

Basically, beside my 'Next Slide' & 'Previous Slide' links, I want to
actually display the actual title of these slides. I am having trouble
figuring out the right strategy to go about this. After many
iterations, this is what I have, which I now can't even seem to trigger
but did work earlier (work meaning, it displayed the title in the label
after clicking the label). Here is what that code looks like:

PrevSlideTitle =
ActivePresentation.SlideShowWindow.Presentation.Slides(SlideShowWindows(1).View.Slide.SlideIndex
- 1).Shapes.Title.TextFrame.TextRange.Text

NextSlideTitle =
ActivePresentation.SlideShowWindow.Presentation.Slides(SlideShowWindows(1).View.Slide.SlideIndex
+ 1).Shapes.Title.TextFrame.TextRange.Text

Label1 = PrevSlideTitle
Label2 = NextSlideTitle

I can figure out how to assign a label (or any other control for that
matter) these default values.

The problems I am having are:
- I can't get this to work properly when I put these label controls on
the slide master. They only seem to work when on individual slides
- They don't do anything until I click on the label
- They don't update when I move to the next or previous slide

Is there an easy way to do this? I am very new at PPT macros but have
VBA experience in Excel & Access.

 
Reply With Quote
 
 
 
 
David M. Marcovitz
Guest
Posts: n/a
 
      20th Jun 2006
I'm a bit short on time so this will be quick. First, you want to check
if there really is a next or previous slide, so you might want an If
statement to make sure that this isn't the first or last slide. You don't
need .SlideShowWindow.Presentation; ActivePresentation.Slides should be
sufficient.

Now you need to figure out two things. What is going to activate this,
and where is the text going to reside. It seems like you are trying to
put this in a shape on the Master slide that will be changed each time
you move from slide to slide. That is fine if you have the code to do
that and shapes on the master slide to hold the text.

You might also want to have an error check to make sure the next and
previous slides have titles (not all slides necessarily have titles).

To activiate your code, you will want the buttons (maybe you should make
them buttons and not labels) execute:

ActivePresentation.SlideShowWindow.View.Next

and then have it run the code to change the text (so you will be on the
correct slide). That is, one macro to move and change text. Otherwise, I
don't know how you are going to activate the change text code.

--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/

(E-Mail Removed) wrote in
news:(E-Mail Removed):

> Hi All-
> Good group here. I've found alot of useful stuff on it but I was
> having trouble figuring this out:
>
> Basically, beside my 'Next Slide' & 'Previous Slide' links, I want to
> actually display the actual title of these slides. I am having
> trouble figuring out the right strategy to go about this. After many
> iterations, this is what I have, which I now can't even seem to
> trigger but did work earlier (work meaning, it displayed the title in
> the label after clicking the label). Here is what that code looks
> like:
>
> PrevSlideTitle =
> ActivePresentation.SlideShowWindow.Presentation.Slides(SlideShowWindows
> (1).View.Slide.SlideIndex - 1).Shapes.Title.TextFrame.TextRange.Text
>
> NextSlideTitle =
> ActivePresentation.SlideShowWindow.Presentation.Slides(SlideShowWindows
> (1).View.Slide.SlideIndex + 1).Shapes.Title.TextFrame.TextRange.Text
>
> Label1 = PrevSlideTitle
> Label2 = NextSlideTitle
>
> I can figure out how to assign a label (or any other control for that
> matter) these default values.
>
> The problems I am having are:
> - I can't get this to work properly when I put these label controls on
> the slide master. They only seem to work when on individual slides
> - They don't do anything until I click on the label
> - They don't update when I move to the next or previous slide
>
> Is there an easy way to do this? I am very new at PPT macros but have
> VBA experience in Excel & Access.
>
>


 
Reply With Quote
 
ryan.crowe@gmail.com
Guest
Posts: n/a
 
      21st Jun 2006
Hi David-
Thanks for the reply. I was able to get the captions to update by
running the code below in the OnSlideShowBegin & OnSlideShowNextSlide
subroutines of the 'EventGen' add-in/module. (OnSlideShowNextSlide
seems to run whether it is "Next" or "Previous" so it may more aptly be
called OnSlideShowChangeSlide)

First, PrevSlideTitle & NextSlideTitle are strings.

'This eliminates the first & last slides from normal label treatment
If SlideShowWindows(1).View.Slide.SlideIndex > 1 And _
SlideShowWindows(1).View.Slide.SlideIndex < _
ActivePresentation.Slides.Count Then
'Determines the previous slide's title (hence the -1)
PrevSlideTitle = ActivePresentation.Slides _
(SlideShowWindows(1).View.Slide.SlideIndex - 1) _
.Shapes.Title.TextFrame.TextRange.Text
'Determines the next slide's title (hence the +1)
NextSlideTitle = ActivePresentation.Slides _
(SlideShowWindows(1).View.Slide.SlideIndex + 1) _
.Shapes.Title.TextFrame.TextRange.Text
'Make sure the labels are visible
SlideMaster.lblPrevSlideTitle.Visible = True
SlideMaster.lblNextSlideTitle.Visible = True
'Apply the caption to the label (also append a <<< or >>>)
SlideMaster.lblPrevSlideTitle.Caption = "<<< " & PrevSlideTitle
SlideMaster.lblNextSlideTitle.Caption = NextSlideTitle & " >>>"
Else
'If last slide, hide the NextSlide label
If SlideShowWindows(1).View.Slide.SlideIndex =
ActivePresentation.Slides.Count Then
PrevSlideTitle = ActivePresentation.Slides _
(SlideShowWindows(1).View.Slide.SlideIndex - 1) _
.Shapes.Title.TextFrame.TextRange.Text
SlideMaster.lblPrevSlideTitle.Caption = "<<< " & PrevSlideTitle
SlideMaster.lblNextSlideTitle.Visible = False
End If
'If first slide, hide the PrevSlide label
If SlideShowWindows(1).View.Slide.SlideIndex = 1 Then
NextSlideTitle = ActivePresentation.Slides _
(SlideShowWindows(1).View.Slide.SlideIndex + 1) _
.Shapes.Title.TextFrame.TextRange.Text
SlideMaster.lblNextSlideTitle.Caption = NextSlideTitle & " >>>"
SlideMaster.lblPrevSlideTitle.Visible = False
End If

End If

And then to move the slideshow, I pasted some code suggested in another
thread to each label's click event (on the master slide):

Private Sub lblNextSlideTitle_Click()
With SlideShowWindows(1).View
.GotoSlide .CurrentShowPosition + 1
End With
End Sub
Private Sub lblPrevSlideTitle_Click()
With SlideShowWindows(1).View
.GotoSlide .CurrentShowPosition - 1
End With
End Sub

>You might also want to have an error check to make sure the next and
>previous slides have titles (not all slides necessarily have titles).


If a slide does not have a title, only the "<<<" or the ">>>" will show
up on the label but that will work for me.

I'm quite certain this code can be refined and I'm open to any that
wish to offer suggestions.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Window Titles/Captions of Processes on Windows Server 2003 Tobias Maier Microsoft C# .NET 0 18th Jun 2008 11:08 AM
Navigation outline titles not displaying slide titles on web pages =?Utf-8?B?QXJsZW5l?= Microsoft Powerpoint 7 9th Nov 2007 07:51 PM
Vista Media Center Sub-titles (closed captions) =?Utf-8?B?QWlyY29vbGVk?= Windows Vista General Discussion 0 29th Jul 2007 09:44 AM
Labels and Captions cougarfighter@gmail.com Microsoft Excel Programming 2 9th Mar 2007 04:26 AM
How to show captions and titles for a photo Roy Windows XP Photos 1 23rd Sep 2005 03:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:48 PM.