If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Displaying 'Next' & 'Previous' Slide Titles In Captions/Textboxes/Labels
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.Sl ides(SlideShowWindows(1).View.Slide.SlideIndex - 1).Shapes.Title.TextFrame.TextRange.Text NextSlideTitle = ActivePresentation.SlideShowWindow.Presentation.Sl ides(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 a - 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. |
#2
|
|||
|
|||
Displaying 'Next' & 'Previous' Slide Titles In Captions/Textboxes/Labels
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/ wrote in oups.com: 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.Sl ides(SlideShowWindows (1).View.Slide.SlideIndex - 1).Shapes.Title.TextFrame.TextRange.Text NextSlideTitle = ActivePresentation.SlideShowWindow.Presentation.Sl ides(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 a - 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. |
#3
|
|||
|
|||
Displaying 'Next' & 'Previous' Slide Titles In Captions/Textboxes/Labels
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. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Disable actions on a powerpointslide when go back to a previous slide | johan | Powerpoint | 3 | December 21st, 2005 05:49 PM |
PowerPoint to HTML - animation using buttons | Mauro Wagner | Powerpoint | 13 | September 1st, 2005 08:37 PM |
return to previosu slide/emergency slide | Peter Crem | Powerpoint | 3 | October 21st, 2004 07:19 PM |
Repeating Slide show with continuous music | Primoz Bradac | Powerpoint | 6 | August 23rd, 2004 09:09 PM |
Automating going to previous slide | Steve | Powerpoint | 7 | August 13th, 2004 09:06 PM |