Share via


Novice Challenge 10: Skip It

Office Programs Required

Microsoft PowerPoint 2007

Goldfish Awarded

20

Deadline for Submission

Friday, May 1, 2009 (8:00 AM Pacific Daylight Time)

Files Required

NoviceChallenge10.pptm in the OfficePalooza Challenge Pack.

When you attend an event – a convention, a fair, a carnival, anything like that – there are several ways of working your way through all the attractions. You could start at one end and methodically stop by each attraction; you could go straight to your favorite attraction and then wander around from there; or you could randomly wander about from the moment you enter.

Believe it or not, you can do the same thing in a Microsoft Office PowerPoint presentation. You can go through a presentation in order, one slide at a time; you can skip slides and jump straight to your favorites; or you can show slides in random order. (Why would you ever want to show your slides in random order? We’re not sure, but it could make for a very interesting presentation.)

To successfully complete this challenge you’ll need to write a VBA subroutine that runs a PowerPoint presentation over and over again non-stop (the user can stop it by pressing the Escape key). But we don’t want the presentation to run these slides in order; instead, we want to skip every other slide. The presentation will show all the slides, but it will show the odd-numbered slides first, then the even-numbered slides. What that means is that when the slide show starts, Slide 1 will be displayed. After two seconds (yes, we want it to advance automatically after 2 seconds) the presentation advances to Slide 3, skipping Slide 2. After two more seconds the presentation advances to Slide 5. When you’ve reached the end of the slide deck, the presentation should continue with Slide 2, then Slide 4, and so on. When all the slides have been shown, the presentation should start over again with Slide 1, again showing odd-numbered slides then even-numbered slides.

One other thing to note: We won’t necessarily be testing your code against the same slide show you see in NoviceChallenge10.pptm. That means that you need to make sure your code works whether there is an odd number of slides in your presentation or an even number of slides. No matter how many slides are in your presentation, your slide show should always show all odd-numbered slides, then all even-numbered slides.

Required: You might find it necessary to use named slides shows in your code to complete this challenge. If you do that, you must delete the named slide show at the end of the subroutine. (We’re requiring this to ease our testing processes).

When you open the Visual Basic editor (which you can do by pressing Alt+F11), there should already be a window open with the subroutine SkipSlides showing. Insert your code into this subroutine. (If you don’t see this subroutine, double-click on Module1 in the Project pane on the left under VBAProject (NoviceChallenge10).) Do not create any other subroutines – all your code should go in here.

Important: Do not add code to save the presentation.

Submitting Your Entry

The OfficePalooza sweepstakes is over, but you’re welcome to try the challenges and learn on your own. Good luck!