I'm not sure I have exactly what you are looking for, but if you go to my
site and go to "Examples From Real People," you might look at the Flash
Card example (currently the first one). It reads questions from a .csv
file:
http://www.loyola.edu/education/PowerfulPowerPoint/
Under "More Tricks," I have examples that write to a file (tricks #1 and #
2). I thought I had an example that reads from a file, but I guess I didn't
post it, but I have plenty of examples that change the text on slides (go
to "Examples by Chapter" and look for examples 6.6, 6.7, and 6.8. Finally,
the following code reads the first 3 lines from a file (mytestfile.txt) and
puts those lines in shapes 1, 2, and 3, 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
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.loyola.edu/education/PowerfulPowerPoint/