Yogi_Bear_79
2006-04-23 14:48:13 UTC
With the help of the AutoEvents PPA I have designed a slide show that will
display a countdown clock. Basically, it reads a text file and displays the
amount of time remaining until the date/time in the text file. The original
design allowed a single slide to be displayed with a one-second advance
time. Thus the effect of counting down every second. A second use of the
slide is to insert it into a large show, and whenever the slide appears it
displays the time remaining.
I wanted to add a new feature for when the slide is displayed in a larger
show. For example, say the countdown slide is shown for 5 seconds on a
larger show. I would like the slide to countdown during those 5 seconds. To
do this, on the Sub Auto_Open() I capture into a global variable the
AdvanceTime of the slide in question. I've included the basic framework
(for brevity) of my module. In the Auto_NextSlide sub you will see my
For/Next loop. I have toyed with a Do While, and a Do Until. None of them
work as expected. I can get a MsgBox to appear for each iteration of the
loop, but that is about it.
I'm starting to think, that I really can not update the textbox on this
slide once it has been updated upon the slides appearance. If that is the
case, the only other way I can think of is to add, say 5 slides into my
slide show, with one second advance times. To give the appearance in a
larger show that it is counting down down.
My plan was then to add a loop in my Sub Auto_NextSlide().
Sub Auto_Open()
Dim objSlide As Object
For Each objSlide In ActivePresentation.Slides
If (objSlide.SlideNumber = iSlide) Then
iAdvanceTime = objSlide.SlideShowTransition.AdvanceTime
End If
Next objSlide
End Sub
Sub Auto_NextSlide(Index As Long)
' Declare variables
.............
' Initialize variables
.......................
If (Index = iSlide) Then
For i = 1 to iAdvanceTime
'Do Stuff to build the strDiff variable
' Display the String
With
ActivePresentation.Slides(iSlide).Shapes("TextBox1")
.TextFrame.TextRange.Text = strDiff
End With
Sleep 1000
i = i+1
Next
End If
End Sub
display a countdown clock. Basically, it reads a text file and displays the
amount of time remaining until the date/time in the text file. The original
design allowed a single slide to be displayed with a one-second advance
time. Thus the effect of counting down every second. A second use of the
slide is to insert it into a large show, and whenever the slide appears it
displays the time remaining.
I wanted to add a new feature for when the slide is displayed in a larger
show. For example, say the countdown slide is shown for 5 seconds on a
larger show. I would like the slide to countdown during those 5 seconds. To
do this, on the Sub Auto_Open() I capture into a global variable the
AdvanceTime of the slide in question. I've included the basic framework
(for brevity) of my module. In the Auto_NextSlide sub you will see my
For/Next loop. I have toyed with a Do While, and a Do Until. None of them
work as expected. I can get a MsgBox to appear for each iteration of the
loop, but that is about it.
I'm starting to think, that I really can not update the textbox on this
slide once it has been updated upon the slides appearance. If that is the
case, the only other way I can think of is to add, say 5 slides into my
slide show, with one second advance times. To give the appearance in a
larger show that it is counting down down.
My plan was then to add a loop in my Sub Auto_NextSlide().
Sub Auto_Open()
Dim objSlide As Object
For Each objSlide In ActivePresentation.Slides
If (objSlide.SlideNumber = iSlide) Then
iAdvanceTime = objSlide.SlideShowTransition.AdvanceTime
End If
Next objSlide
End Sub
Sub Auto_NextSlide(Index As Long)
' Declare variables
.............
' Initialize variables
.......................
If (Index = iSlide) Then
For i = 1 to iAdvanceTime
'Do Stuff to build the strDiff variable
' Display the String
With
ActivePresentation.Slides(iSlide).Shapes("TextBox1")
.TextFrame.TextRange.Text = strDiff
End With
Sleep 1000
i = i+1
Next
End If
End Sub