Automatically Display Updated Text Box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am writing a presentation for our local soccer club to teach the laws of soccer to parents. I have a "quiz" master page that is the starting point for the users to select one of 17 quizzes. I am able to track the score the users get during the quiz, and I want to display it on the page when they return to the master page. My macro works fine, but I cannot figure out how to have it automatically update the text box when the user simply returns to the screen.

I don't want to have to require them to click on a button to see the score. The macro is as follows

Sub QuizResults(
If TotQuestions = 0 The
ActiveWindow.Presentation.Slides(81).Shapes("Results").TextFrame.TextRange.Text = "(Quiz not started yet)
Els
ActiveWindow.Presentation.Slides(81).Shapes("Results").TextFrame.TextRange.Text = "(Your total is: " & TotRight & "/" & TotQuestions & " correct answers)
End I
End Su

Any suggestions

Allan
 
What I do is to create a text box (actually inside my podium for the
person's image) that I assign a name to. When you create an object
PowerPoint assigns a name to it (like "TextBox101"). There is a little
macro that will allow you to assign the name you want. The macro goes:

Sub NameShape()
Dim Name$
On Error GoTo AbortNameShape

If ActiveWindow.Selection.ShapeRange.Count = 0 Then
MsgBox "No Shapes Selected"
Exit Sub
End If
Name$ = ActiveWindow.Selection.ShapeRange(1).Name

Name$ = InputBox$("Give this shape a name", "Shape Name", Name$)

If Name$ <> "" Then
ActiveWindow.Selection.ShapeRange(1).Name = Name$
End If
Exit Sub

AbortNameShape:
MsgBox Err.Description

End Sub

You merely select your object you created, run this macro, type in a new
name (like Score1), then press ENTER. PowerPoint now stores this name for
your object. Then you assign your text to the value of that text box (which
I run from a button on a respective slide). My code adds the text to your
object, then goes to the desired slide. For example:

ActivePresentation.Slides(3).Shapes("Score1").TextFrame.TextRange.Text =
intScore1
ActivePresentation.SlideShowWindow.View.GotoSlide (3)

Hope that helps! By the way, the NameShape macro is also available as an
add-in from the following site:

http://www.mvps.org/skp/download.htm (the Rename Shape/Slide add-in)

--
Bill Foley, Microsoft MVP (PowerPoint)
www.pttinc.com
Check out PPT FAQs at: http://www.rdpslides.com/pptfaq/
"Success, something you measure when you are through succeeding."

Allan said:
I am writing a presentation for our local soccer club to teach the laws of
soccer to parents. I have a "quiz" master page that is the starting point
for the users to select one of 17 quizzes. I am able to track the score the
users get during the quiz, and I want to display it on the page when they
return to the master page. My macro works fine, but I cannot figure out how
to have it automatically update the text box when the user simply returns to
the screen.
I don't want to have to require them to click on a button to see the
score. The macro is as follows:
Sub QuizResults()
If TotQuestions = 0 Then
ActiveWindow.Presentation.Slides(81).Shapes("Results").TextFrame.TextRange.T
ext = "(Quiz not started yet)"
ActiveWindow.Presentation.Slides(81).Shapes("Results").TextFrame.TextRange.T
ext = "(Your total is: " & TotRight & "/" & TotQuestions & " correct
answers)"
 
Bil

When I put in the SlideShowWindows string I get an error of "Compile error: Method or data not found" and the string ".SlideShowWindow" is higlighted. Any suggestions
 
Open the VBE window, click "Tools", "References" and let me know which ones
you have checked. Do any say "Missing"?

--
Bill Foley, Microsoft MVP (PowerPoint)
www.pttinc.com
Check out PPT FAQs at: http://www.rdpslides.com/pptfaq/
"Success, something you measure when you are through succeeding."

Allan said:
Bill

When I put in the SlideShowWindows string I get an error of "Compile
error: Method or data not found" and the string ".SlideShowWindow" is
higlighted. Any suggestions
 
Visual Basic for Application
Microsoft Powerpoint 11.0 Visual Object Librar
OLE Automatio
icrosoft Office 11.0 Visual Object Librar

are checked. Nothing else is checked. Nothing is marked as "missing

Alla

----- Bill Foley wrote: ----

Open the VBE window, click "Tools", "References" and let me know which one
you have checked. Do any say "Missing"

--
Bill Foley, Microsoft MVP (PowerPoint
www.pttinc.co
Check out PPT FAQs at: http://www.rdpslides.com/pptfaq
"Success, something you measure when you are through succeeding.

Allan said:
error: Method or data not found" and the string ".SlideShowWindow" i
higlighted. Any suggestion
 
Sorry again, teaching all day and was out of the office this evening. You
need to add the MS Forms 2.0 object library. Not sure if the version number
has changed with PPT 2003, but mine says:

Microsoft Forms 2.0 Object Library

Try it again after setting this reference!
 
I'm stuck here. Shyam, any ideas??? Hopefully he (or someone else more VBA
knowledgeable than me) will pop in and assist!
 
Back
Top