Thread: [Solved] Powerpoint VBA: Help Needed
View Single Post
 
Old 12-13-2011, 08:28 AM
JohnWilson JohnWilson is offline Windows 7 64bit Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,914
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

You shouldn't have duplicate declarations in one module.

Try this using Select case
Code:
Sub OnSlideShowPageChange(ByVal SSW As SlideShowWindow)
Dim Team1Scr As String
Dim Team2Scr As String
Select Case SSW.View.CurrentShowPosition

Case Is = 8
Team1Scr = InputBox("Enter Team 1 Score:", "Scores")
ActivePresentation.Slides(8).Shapes("Scr1").TextFrame.TextRange.Text = Team1Scr
Team2Scr = InputBox("Enter Team 2 Score:", "Scores")
ActivePresentation.Slides(8).Shapes("Scr2").TextFrame.TextRange.Text = Team2Scr

 
Case Is = 16
Team1Scr = InputBox("Enter Team 1 Score:", "Scores")
ActivePresentation.Slides(16).Shapes("Scr1").TextFrame.TextRange.Text = Team1Scr
Team2Scr = InputBox("Enter Team 2 Score:", "Scores")
ActivePresentation.Slides(16).Shapes("Scr2").TextFrame.TextRange.Text = Team2Scr
    
End Select
    
End Sub
A word of warning OnSlideShowPageChange is NOT a reliable method and not supported/documented by Microsoft. Before using it in an important setting try saving, close PowerPoint and reopen. Does it still work??

I've removed theSendKeys lines. What were they for? The effect would be to move on to the next slide or animation.
Reply With Quote