How do you code an exit button on the presentation?

M

M Skabialka

I have a slide presentation that runs in a kiosk. It shows a menu which
links to other presentations and another menu.

All works well until the presentation is over; the user presses the ESC key,
it goes back to slide sorter mode, then they close PowerPoint.

This looks ugly, so I tried adding a button which says exit. The code
behind it is

Private Sub cmdExit_Click()
application.quit.
End Sub

The first time I clicked it the application closed, but not since - now
nothing happens. I have checked the code, it hasn't changed. The button is
named cmdExit.

I even tried adding another button, still nothing.

What could be wrong?
Thanks,
Mich
 
M

Michael Koerner

Change the file extensions from .PPT to .PPS, or save it as a PowerPoint
Slideshow

--
<>Please post all follow-up questions/replies to the newsgroup<>
<><>Email unless specifically requested will not be opened<><>
<><><>Do Provide The Version Of PowerPoint You Are Using<><><>
<><><>Do Not Post Attachments In This Newsgroup<><><>
Michael Koerner [MS PPT MVP]


|I have a slide presentation that runs in a kiosk. It shows a menu which
| links to other presentations and another menu.
|
| All works well until the presentation is over; the user presses the ESC
key,
| it goes back to slide sorter mode, then they close PowerPoint.
|
| This looks ugly, so I tried adding a button which says exit. The code
| behind it is
|
| Private Sub cmdExit_Click()
| application.quit.
| End Sub
|
| The first time I clicked it the application closed, but not since - now
| nothing happens. I have checked the code, it hasn't changed. The button
is
| named cmdExit.
|
| I even tried adding another button, still nothing.
|
| What could be wrong?
| Thanks,
| Mich
|
|
 
D

David M. Marcovitz

It should be:

Application.Quit

I don't think it will like the period you put at the end of that line.

Why do you need code for this? Why not just save the file as a PowerPoint
Show (.pps)? Then when the file is double-clicked it will automatically
go into show mode and when the show is exited, the application will quit.

--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 
M

M Skabialka

There isn't a period - bad typing on my part...

When I changed it to a .pps none of the hyperlinks to the other .ppt files
would work. Do they all have to be .pps if the master is?

Buttons don't work on .ppt files?
 
J

John Wilson

Hi

Try

activepresentation.application.quit


M Skabialka said:
There isn't a period - bad typing on my part...

When I changed it to a .pps none of the hyperlinks to the other .ppt files
would work. Do they all have to be .pps if the master is?

Buttons don't work on .ppt files?
 
D

David M. Marcovitz

The behavior you are describing is not normal. Hyperlinks should work for
PPT and PPS files (no, the other files do not need to be PPS files), and
Application.Quit should work. In fact, PPS files should behave
identically to PPT files other than going straight into Slide Show mode
and leaving PowerPoint altogether when quitting. I think your
installation of PowerPoint is having some problems. You might try going
to the Help menu and choosing Detect and Repair as well as Check for
Updates. I cannot reproduce any of the errant behavior you describe.
--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 
M

M Skabialka

I did the repair, recreated the button, added code:

Private Sub cmdExit_Click()
activepresentation.application.quit
End Sub

ran the presentation and the code worked - once! The presentation closed,
so did PowerPoint.

I opened it again and the button is now useless; you can see it depress but
nothing happens. If I add stop in the code, it doesn't stop!

All updates to Windows and Office have been applied, even the one to change
the time zones for Australia for the Commonwealth Games!

Any other ideas?
Mich
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top