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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting PPT slide show to execute 1

Status
Not open for further replies.

white605

Technical User
Jan 20, 2003
394
US
The following code in a click event on a form will open and display a ppt file with powerpoint, not the viewer installed on this computer, however the slide show does not play, it just sits there on the first screen for the time in the wait command. I saved the file with one second intervals and have applied the settings to all the slides. I cannot find a command or setting to get it going.
Code:
* Clean out any existing references to servers.
* This prevents memory loss to leftover instances.
RELEASE ALL LIKE o*

* For demonstration purposes, make oPowerPoint and oPresentation
* available after this program executes.
PUBLIC oPowerPoint, oPresentation

SET PATH TO "c:\pptapp"

* Open PowerPoint
oPowerPoint = CreateObject("PowerPoint.Application")
oPowerPoint.Visible = .T.

*open the file
oPresentation = getobject("c:\pptapp\Helpful_Full.ppt")

oPresentation.Application.visible = .t.


* Run the slideshow.
*Both Methods to run the show give the same results 
*oPresentation.SlideShowSettings.Run()

With oPresentation.SlideShowSettings
      .ShowType = 3
      .LoopUntilStopped = 1
      .RangeType = 1
      .AdvanceMode = 2
      .Run
   EndWith

*put total runtime in timeout
WAIT WINDOW [waiting for the show to finish] TIMEOUT 25

*exit powerpoint
oPowerpoint.quit

* Clean out any existing references to servers.
* This prevents memory loss to leftover instances.
RELEASE ALL LIKE o*
thanks
wjwjr
 
wjwjr,

I found that by removing the ShowType setting, just the following 5 lines of code runs the powerpoint file shown
Code:
oPresentation = getobject("I:\AGM, Confs and StaffDays\AGM\05\aboutfr.ppt")
opresentation.SlideShowSettings.LoopUntilStopped = 1
opresentation.SlideShowSettings.RangeType = 1opresentation.SlideShowSettings.AdvanceMode = 2
opresentation.SlideShowSettings.Run()


Hope that helps,

Stewart
PS If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Stewart, Thanks for the code - Got it going
wjwjr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top