You may want to look into the TypeLib Information library (tlbInf32.dll). I
don't know how well it will work through VBA, but it should do fine, VBA is
just like any other ActiveX language I think.
I've used it to enumerate constants, enums, and method names. I haven't
found a lot of great documentation for it though, but check on google, and
you should find some sample code.
Lance
Yes, I think the Case statement is the way you will have to go, unless
someone else here has better information.
Bill Foley is the other PowerPoint/VBA Quiz expert here. I don't know if he
has done what you want with linking PowerPoint and Access. It is certainly
possible, but I have never done it.
I have created quizzes by reading the questions from a text file. I could
imagine that it wouldn't be too hard to create an Access database of quiz
questions, use queries to pick the questions you want and dump the results
to a text file that could be read by PowerPoint. This is probably a
convoluted way to do this, but if you're interested in pursuing it, here is
some simple code that reads the first line of a text file as the question
and the next two lines as the answers and then adjusts the question on
slide 2:
Sub AdjustQuestion()
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim fs, f
Dim theQuestion As String
Dim answer1 As String
Dim answer2 As String
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile("mytestfile.txt", ForReading, TristateFalse)
theQuestion = f.readline
answer1 = f.readline
answer2 = f.readline
ActivePresentation.Slides(2).Shapes(1).TextFrame.TextRange.Text _
= theQuestion
ActivePresentation.Slides(2).Shapes(2).TextFrame.TextRange.Text _
= answer1
ActivePresentation.Slides(2).Shapes(3).TextFrame.TextRange.Text _
= answer2
f.Close
End Sub
I'm glad you enjoyed my book. I also would be interested in someone taking
this to the next level and writing a more advanced book, but, for the time
being, that someone isn't me.
--David
--
David M. Marcovitz
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/