nivini
Programmer
- Mar 24, 2004
- 64
Hi All
I need to use keypress event while the ppt file run, in order to change to another ppt file. In short , what the code suppose to do is that: when a user press key 49 (that's '1') pp1.ppt start running, if the user want to stop pp1.ppt and start pp2.ppt he press '2' , and the other way round.
The code below gives me the right ppt file running, but the second keypress event is 'useless' since on the screen there's the ppt file run.
Now, how can i jump from one ppt file to another, with the keypress event?
I mailed this question before, but got no answer, and i do need the help badly
TIA
Nivini
I need to use keypress event while the ppt file run, in order to change to another ppt file. In short , what the code suppose to do is that: when a user press key 49 (that's '1') pp1.ppt start running, if the user want to stop pp1.ppt and start pp2.ppt he press '2' , and the other way round.
The code below gives me the right ppt file running, but the second keypress event is 'useless' since on the screen there's the ppt file run.
Now, how can i jump from one ppt file to another, with the keypress event?
Code:
Option Explicit
Option Base 1
Dim objPP As PowerPoint.Application
--------------------------------------
Private Sub Form_KeyPress(KeyAscii As Integer)
Set objPP = New PowerPoint.Application
Dim PP As PowerPoint.Presentation
Dim str As String
DoEvents
Set objPP = New PowerPoint.Application
objPP.Visible = True
Select Case KeyAscii
Case 49
str = "D:\PP\ppt1.ppt"
Case 50
str = "D:\PP\pp2.ppt"
End Select
Set PP = objPP.Presentations.Open(str, True)
With PP
.SlideShowSettings.Run
End With
End Sub
I mailed this question before, but got no answer, and i do need the help badly
TIA
Nivini