Microsoft KB Archive/264112

= PPT2000: How to Start a PowerPoint 2000 Slide Show from Another Program =

Article ID: 264112

Article Last Modified on 10/11/2006

-

APPLIES TO


 * Microsoft PowerPoint 2000 Standard Edition

-



This article was previously published under Q264112



SUMMARY
The following macro demonstrates how to start a Microsoft PowerPoint 2000 slide show from another Microsoft Office program by using Visual Basic for Applications and how to run a show that starts on a slide other than slide one.



MORE INFORMATION
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. For more information about how to use the sample code in this article, click the article number below to view the article in the Microsoft Knowledge Base:

212536 OFF2000: How to Run Sample Code from Knowledge Base Articles

Code Sample
Before you use this code, you must set a reference to the Microsoft PowerPoint object model in the Microsoft Office program in which you are writing your code. Follow these steps to add the reference:
 * 1) Inside the Visual Basic Editor, on the Tools menu, click References.
 * 2) In the References - VBAProject dialog box, click to select the Microsoft PowerPoint 9.0 Object Library check box.
 * 3) Click OK.

You now have a reference (in this project) to the PowerPoint 2000 object model.

Sub launchShow Dim oPPT As PowerPoint.Application Dim oPres As PowerPoint.Presentation

' Set oPPT to the PowerPoint Application object. '  Set oPPT = CreateObject(&quot;Powerpoint.Application&quot;)

' Make PowerPoint visible. '  oPPT.Visible = msoTrue

' Set oPres to be equal to the Filename and path. Replace ' ' ****** ' ' with the correct path and file name to the presentation. ' ' For example: ' Set oPres = oPPT.Presentations.Open(&quot;c:\Presentations\Pres1.ppt&quot;) '   Set oPres = oPPT.Presentations.Open(&quot;&quot;) With oPres.SlideShowSettings

' Set the starting slide and ending slide range. Replace ' ' ****** ' ' with the index number of first slide you want to start the ' slide show from. Replace ' ' ****** ' ' with the slide index number you want to end the show on. ' ' For example: '     .StartingSlide = 3 '     .EndingSlide = 12 '     .StartingSlide =  .EndingSlide = 

' Set the slide show to use the above range of slides. ' Then set the slide show to show full screen. '     .RangeType = ppShowSlideRange .ShowType = ppShowTypeSpeaker ' Run the slide show. '    .Run End With End Sub

Additional query words: vba automate remote VBE

Keywords: kbdtacode kbhowto kbprogramming KB264112

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.