Programming during SlideShow

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have PPT 2003. I have a one-slide slideshow that simply repeats its list of
current events all day long, using a Credit effect. I have inserted the
current date/time "footer" to update automatically. The time is formatted to
show minutes.

When the slideshow runs, the time does not update. I tried writing an event
script to update it, but nothing happens:

Public WithEvents App As Application
Private Sub App_SlideShowNextSlide(ByVal Wn As SlideShowWindow)
Dim CurPres As Slide
Set CurPres = ActivePresentation.Slides(1)

CurPres.Shapes("Rectangle 209").Select
ActiveWindow.Selection.TextRange.Text = Now()
End Sub

I set the slide show to run until ESC, and no change in time.

I used the SlideShowNextBuild event and turned on repeats for the effect,
which had no effect on the time, either.

Thanks for any ideas!

George
 
While in Slide Show mode, you cannot select your text box. You can modify
your code to use the following:

ActivePresentation.Slides(1).Shapes("Rectangle 209") _
.TextFrame.TextRange.Text = Now()

That will update a shape named "Rectangle 209" on the first slide to have
the current date and time. You could put this in a sub and assign the
sub to a button and click the button when you want to update, but that is
probably not what you want. Alternatively, you can loop with something
like the following:

Sub KeepUpdatingTime()
Do While True
ActivePresentation.Slides(1).Shapes("Rectangle 209") _
.TextFrame.TextRange.Text = Now()
DoEvents
Loop
End Sub

This wouldn't start automatically, but it would keep updating the time
once you click a button once to start it.

--David
--
David M. Marcovitz
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/
 
Hey, thanks for the reference, Mike! Looks like you have a mess o' good
stuff, there. I'll check it all out.

George
 
David,
Thanks for the code revision. I managed to get it to work after I put it
into a nextbuild event and tweaked it a bit:

Private Sub App_SlideShowNextBuild(ByVal Wn As SlideShowWindow)
ActivePresentation.Slides(1).Shapes("rectangle 209") _
.TextFrame.TextRange.Text = ""
ActivePresentation.Slides(1).Shapes("rectangle 209") _
.TextFrame.TextRange.Text = Format(Now(), "mm/dd/yyyy hh:mm")
End Sub

But I find that I need to run a routine to activate the events:
Sub InitializeApp()
Set X.App = Application
End Sub

And right now, I have to run it manually. I'm working on a way to get it to
run automatically.

George
 
Your welcome but the thanks go to Chirag as it is his site and he is much
more altrustic than I am. ;-)
 
Back
Top