G
GDaniec
Hi!
I have to collect data in dynamic way (from file) and insert that data
into a powerpoint presentation. The file is changing every second.
Then, if the value of data in file is apropriate, the movie from mpg
file has to be shown.
When the movie is finished, slide with data from file has to be shown
again.
I've been trying to solve it creating three slides.
The first one consist only a command button to start action.
When the button is pressed the code is executed (from now on,
everything has to be done automaticaly - without mouse):
- redirecting to the second slide with data collected from file
- in do while loop data are collected from file every second
- if data is greater then 6 the movie has to be shown, and when it
finished we have to come back to the second slide and continue the
loop
My code looks like that:
Private Sub CommandButton1_Click()
Dim gr As Integer
Dim TMinus As Integer
SlideShowWindows(1).View.GotoSlide (2)
TMinus = 30
Do While (TMinus > -1)
' Suspend program execution for 1 second (1000
milliseconds)
Open "strony.txt" For Input As #1
Input #1, gracz1
Close #1
Sleep 1000
ActivePresentation.Slides(2).Shapes(7).TextFrame.TextRange.Text = gr
If gr > 6 Then
'SlideShowWindows(1).View.GotoSlide (3)
End If
TMinus = TMinus - 1
DoEvents
Loop
End
End Sub
I am new to VBA programming. I don't know how to suspend the loop,
show the movie, come back to slide two and continue "Do While". Can
anyone help me?
I have to collect data in dynamic way (from file) and insert that data
into a powerpoint presentation. The file is changing every second.
Then, if the value of data in file is apropriate, the movie from mpg
file has to be shown.
When the movie is finished, slide with data from file has to be shown
again.
I've been trying to solve it creating three slides.
The first one consist only a command button to start action.
When the button is pressed the code is executed (from now on,
everything has to be done automaticaly - without mouse):
- redirecting to the second slide with data collected from file
- in do while loop data are collected from file every second
- if data is greater then 6 the movie has to be shown, and when it
finished we have to come back to the second slide and continue the
loop
My code looks like that:
Private Sub CommandButton1_Click()
Dim gr As Integer
Dim TMinus As Integer
SlideShowWindows(1).View.GotoSlide (2)
TMinus = 30
Do While (TMinus > -1)
' Suspend program execution for 1 second (1000
milliseconds)
Open "strony.txt" For Input As #1
Input #1, gracz1
Close #1
Sleep 1000
ActivePresentation.Slides(2).Shapes(7).TextFrame.TextRange.Text = gr
If gr > 6 Then
'SlideShowWindows(1).View.GotoSlide (3)
End If
TMinus = TMinus - 1
DoEvents
Loop
End
End Sub
I am new to VBA programming. I don't know how to suspend the loop,
show the movie, come back to slide two and continue "Do While". Can
anyone help me?