Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Dec 2009
    Location
    UK
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Powerpoint VBA: Building a quiz

    I am making a quiz based on Powerpoint. It is mostly working ...

    For questions, I am using a single slide with the question as the caption on a Command Button. I have no problem changing the Caption when moving from slide to slide. Where I have a big problem is making sure the Caption for the first question is correct. I cannot find a way to reference the Caption before the slide is displayed for the first time. If I reverse back into the slide from Slide 2 all is fine.

    Any thoughts on how I can execute a small piece of code after moving to the slide, but prior to the display happening. The Microsoft examples are somewhat obscure to me!

    Many thanks

    Neil

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    3 Star Lounger
    Join Date
    Feb 2007
    Location
    Durham, Durham, United Kingdom
    Posts
    279
    Thanks
    0
    Thanked 6 Times in 6 Posts
    Hi njw

    First there is no need at all to use command buttons in PowerPoint to run code. A standard shape will work just fine and is much easier to code.

    You do not give many details:

    Are you using the pseudo event OnSlideShowPageChange??

    If so this is unreliable and will often not fire until other code has run. You could probably fix this by having code before the quiz e.g. "What is your name" on slide 1

  4. #3
    New Lounger
    Join Date
    Dec 2009
    Location
    UK
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks John.

    I already have introductory slides that open up spreadsheets etc. My problem, is how to access a slide when it is not the current slide. What I need to be able to do is:

    1. Display intro slide (slide 1)
    2. When Next button clicked, change Caption text on Button on Slide 2 to ensure it is the first question text.
    3. Display Slide 2

    Many thanks

    Neil

  5. #4
    3 Star Lounger
    Join Date
    Feb 2007
    Location
    Durham, Durham, United Kingdom
    Posts
    279
    Thanks
    0
    Thanked 6 Times in 6 Posts
    I'll say this one more time then

    DON'T USE COMMAND BUTTONS.

    If your question is in eg a placeholder that is Shape2 on Slide 2 and the question is held in strQ

    ActivePresentation.Slides(2).Shapes(2).TextFrame.T extRange=strQ
    SlideShowWindows(1).View.GoToSlide 2

    Website adds odd spaces in T extRange - take them out

  6. #5
    New Lounger
    Join Date
    Dec 2009
    Location
    UK
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi John

    The reason I used a command button was because using a shape didn't work for me. I'll give it another go.

    Many thanks

    Neil

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •