Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

powerpoint presentations from vb

Status
Not open for further replies.

nivini

Programmer
Mar 24, 2004
64
0
0
Hello all
I have this code
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

what I need to do is when a user press key 49(thats the '1') a presentation is showed, when the user press key 50 (thats the '2') the first presentation (pp1.ppt)is stopped and other presentation (pp2.ppt)is showed. and viceversa
But what happens is that after the first presentation is showed the keypress event is no longer available for me, since on the screen theres the presentation running.
How can i stop the running presentation and start run the other one with a keypress event??

Many thanks in advnce
Nivini
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top