Re: Auto Run Macro

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Crumplezone@xxxxxxxxxxxxxxxx wrote:
Version: 2004
Operating System: Mac OS X 10.3 (Panther)
Processor: Power PC

I need a Powerpoint presentation to make Powerpoint (or Powerpoint viewer) automatically quit at the end of the presentation. I've looked at many web sites which give me a partial solution, but I think I need a step by step guide as I can't get anything to work. Maybe the Mac version is different, I don't know.

I have this bit of script

Sub OnSlideShowPageChange(ByVal SSW As SlideShowWindow)
If SSW.View.CurrentShowPosition = _
SSW.Presentation.SlideShowSettings.EndingSlide Then

MsgBox "Last slide in the slide show"
End If
End Sub

Apparently an event is triggered every time a slide changes and also when the last slide is reached. The above script should trigger a message box when the last slide is reached apparently.

So in theory all I have to do is use this bit of script

Sub quit()
'
Application.quit
Set ppApp = Nothing
'

End Sub

instead of the message box bit of the script and that will make Powerpoint automatically quit.

I can get the application to quit on a mouse click by assigning it to a bit of text using action settings, but I can't for the life of me work out how to get it to run automatically on the 'last slide' event.

I don't know if I'm just being dumb, I haven't used Powerpoint too much, but I can usually work out stuff like this from articles I find on the web, but I've been messing about with this for a couple of days and got nowhere. I've tried a few things, one article said that there should be a 'PPTEvent' in the Object browser, but I couldn't find it. Obviously the program help isn't much help.

Any help greatly appreciated.

Hi,

When you are in the visual basic editor search HELP (not the object browser) for the word

event

You will get a list of all events available to you along with code samples.

-Jim

--
Jim Gordon
Mac MVP
http://mvp.support.microsoft.com/

WE NEED YOUR HELP!
The number of new Mac users has skyrocketed. That’s excellent. In this forum all answers come from other users, not from Microsoft employees. Please help answer questions.

If you see an unanswered question that you know the answer to, please take just a moment to post the answer. Doing so speeds response time for people who come here and need fast responses.

If you see an answer that might be wrong or that you can answer better, hop right in and offer your thoughts. Don’t berate a wrong answer – we’re all here trying to help each other.

Don’t bother with questions you’re not quite sure about or don’t know about.

Please take just a moment to help fellow Mac users. Your efforts will be appreciated greatly - especially by those you help.
.



Relevant Pages

  • Re: vba PowerPoint and Shapes
    ... current script works fine... ... Sub DimAndGo ... I have multiple shapes on slide 1. ... Microsoft PowerPoint MVP ...
    (microsoft.public.powerpoint)
  • Re: vba PowerPoint and Shapes
    ... Sub DimAndGo ... script option might solve for the fact that I click and go to another slide, ... Author of _Powerful PowerPoint for Educators_ ...
    (microsoft.public.powerpoint)
  • Auto Run Macro
    ... Sub OnSlideShowPageChange ... MsgBox "Last slide in the slide show" ... The above script should trigger a message box when the last slide is reached apparently. ... instead of the message box bit of the script and that will make Powerpoint automatically quit. ...
    (microsoft.public.mac.office.powerpoint)
  • Re: How to know time spent on each slide while presenting live?
    ... I could imagine a simple VBA script that could help. ... Something like this would require a button on the first slide to activate ... Sub DiscoverTimings() ... Dim currentSlideNum As Long ...
    (microsoft.public.powerpoint)
  • Re: Detecting is hyperthreading is enabled with WMI?
    ... It is too bad that WMI does not give this info. ... have to be done to the script. ... Public Sub DisplayProcessorInfo ... dim ProcessorSet, Processor ...
    (microsoft.public.windowsxp.wmi)