How to add VBA code to a slide

D

DB

I'm new to VBA and have run into a brick wall. I'm working on a quiz
in PowerPoint 2003 and found a great example by Shyam that I'd like to
incorporate into my presentation. The dilema is that there are 2
slides that show up in the Editor in a PowerPoint Objects folder
instead of Modules and I can't figure out how to duplicate that in my
own project. Am I wrong in thinking the code is either in or is part
of the slide itself? If so, how do you do that? Any assistance would
be appreciated. Thanks.

Dawn
 
J

John Wilson

Would maybe help if you said which of Shyam's examples it was. However it
sounds like the code is attached to a control toolbox object probably a
command button. You should be able to see the buttons on the two slides.
Right click in edit mode and choose view code.
 
D

DB

Would maybe help if you said which of Shyam's examples it was. However it
sounds like the code is attached to a control toolbox object probably a
command button. You should be able to see the buttons on the two slides.
Right click in edit mode and choose view code.
--
Amazing PPT Hints, Tips and Tutorials-http://www.PPTAlchemy.co.ukhttp://www.technologytrish.co.uk/ppttipshome.html
email john AT technologytrish.co.uk






- Show quoted text -

Sorry, it was called Quiz in PowerPoint Using VBA from the following
site: http://skp.mvps.org. I'll try your suggestion John and check
the site you listed Lucy and let you know.
 
J

John Wilson

The questions and answers are set in module 1 using the arrays Qs( ) and Ans( )
 
D

David M. Marcovitz

PowerPoint VBA has many oddities, and this is one of them. When you add
objects via the control toolbox, those objects are generally programmed
in a slide module. If you add one of those objects and double-click, a
new module named Slide1 (if you're on slide 1) will be added. This module
contains the procedures that relate directly to that object (e.g., what
happens if you click on a control button or what happens if you change
the text in a text box). However, you can also access these controls from
any other module, such as Module 1.

If your goal is to duplicate Shyam's example, then add the control items
in his example to a slide and double-click. If there is stuff in Module
1, then, when in the VBA editor, choose Module from the Insert menu.

The key here is to be sure to use controls when his example uses
controls. Similar things can be done with regular Autoshapes, but his
example is written using controls.

--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/
 

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