Here are the steps I took to apply Action Settings to the text boxes:
1) Right-click on a text box, select "Action Settings"
2) Select "Run Macro" radio button
3) Set macro to (for example) "AddHome"
I've copied all of the macro code below. You may notice that different
code is being ran for edit mode. I've tried removing all of the edit
mode code, but that didn't help anything.
If anyone would like to download the presentation itself, I have placed
it at my website at "Scoreboard.ppt":
http://www.geocities.com/daveinmatrix/
Thank you in advance for any help you can provide!
-- DaveInMatrix
' ----------------------------------------------------
Option Explicit
Const STR_TEXT_HOME_SCORE = "Text Box 32"
Const STR_TEXT_VISITOR_SCORE = "Text Box 34"
' Adds an amount to a text box that contains an integer.
' Use negative numbers to subtract. Call like this:
' UpdateScore STR_TEXT_HOME_SCORE, 1
Sub UpdateScore(strBox As String, nAddAmount As Integer)
' The objects on the slide have different parent objects
' depending on whether the slideshow is currently running
' or we are in editor mode. So different macro code is
' required in each situation. To get around this, trap
' the error that occurs when we attempt to access a
' slideshow object in editor mode. Then go to the editor
' mode alternative code.
On Error GoTo UseEditModeCode
' Code that works in slideshow mode but not editor mode
With
ActivePresentation.SlideShowWindow.View.Slide.Shapes(strBox).TextFrame.TextRange
.Text = .Text + nAddAmount
End With
Exit Sub
UseEditModeCode:
' Code that works in editor mode but not slideshow mode
With
ActiveWindow.Selection.SlideRange.Shapes(strBox).TextFrame.TextRange
.Text = .Text + nAddAmount
End With
End Sub
Sub AddHome()
UpdateScore STR_TEXT_HOME_SCORE, 1
End Sub
Sub SubHome()
UpdateScore STR_TEXT_HOME_SCORE, -1
End Sub
Sub AddVisitor()
UpdateScore STR_TEXT_VISITOR_SCORE, 1
End Sub
Sub SubVisitor()
UpdateScore STR_TEXT_VISITOR_SCORE, -1
End Sub
' ----------------------------------------------------