Open/View/Close a Powerpoint Presentation File
Open/View/Close a Powerpoint Presentation File
API Declarations
*'Add Microsoft Powerpoint 8.0Oject Library Office '97 in References
*'This code snipplet come from Microsoft Office Development site
Add commandbuuton in the from and name it cmdOpenPPT
In cmdOpenPPT_Click add the code below:
OpenPresentation(strFilename)
'* strFilename = Powerpoint Presentation File
Rate Open/View/Close a Powerpoint Presentation File
(1(1 Vote))
Sub OpenPresentation(strFilename As String)
Dim oPPT As PowerPoint.Application
Set oPPT = New PowerPoint.Application
'open a powerpoint file
With oPPT
.Visible = True
.Presentations.Open (strFilename)
.Presentations(strFilename).Close
End With
'View the slide show
'Sleep 500
With oPPT.ActivePresentation.SlideShowSettings
.AdvanceMode = ppSlideShowUseSlideTimings
.Run
End With
'Wait until there are no more slide show windows and then quit
'Powerpoint
Do
' Sleep 1000
Loop While oPPT.SlideShowWindows.Count > 0
oPPT.Quit
Set oPPT = Nothing
End Sub
Private Sub cmdOpenPPT_Click()
OpenPresentation "c:\files\takefive.pps"
End Sub
Open/View/Close a Powerpoint Presentation File Comments
No comments yet — be the first to post one!
Post a Comment