• Powerpoint VBA: Building a quiz

    Author
    Topic
    #491158

    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

    Viewing 3 reply threads
    Author
    Replies
    • #1414598

      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

    • #1414751

      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

    • #1414843

      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.TextRange=strQ
      SlideShowWindows(1).View.GoToSlide 2

      Website adds odd spaces in T extRange – take them out

    • #1414844

      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

    Viewing 3 reply threads
    Reply To: Powerpoint VBA: Building a quiz

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: