nsalyani
05-15-2011, 09:53 PM
Hi to All,
First time user of this Forum, Hopefully I can get some help on this.
THE REQUIREMENT:
I have a PowerPoint page with 4 squares (from autoshapes). Each square has some text in it which I have set to appear one after the other in each of the boxes upon mouse click using custom animation tools.
Once the text appears, I have an Action Setting on each box for a MACRO to run on each of the boxes upon click of the box. The Macro (in VBA seen below) is expected to change the color of the box to orange first. If the box selected is the correct one, the color of that box changes to green. If the box selected is incorrect, the color of the correct box should turn green.
THE ISSUE:
The Problem I am facing is that since I am bringing in the text into the boxes VIA custom Animation, when the Macro runs on the box, the color changes correctly, but the text in all the boxes disappears.
If however, I do not use custom Animation to bring in the text, everything works as it is suppposed to. But my requirements is to being in the text into the boxes one by one.
SAMPLE CODE FOR THE COLOR CHANGE:
Sub SelectAnswer1(shpA As Shape)
Dim shp2 As Shape
Dim ss As Slide
shpA.Fill.ForeColor.RGB = RGB(255, 165, 0)
For Each ss In ActivePresentation.Slides
For Each shpA In ss.Shapes
If shpA.HasTextFrame Then
If StrComp(shpA.TextFrame.TextRange, "Text1", vbTextCompare) = 0 Then
shpA.Fill.ForeColor.RGB = RGB(124, 242, 0)
For Each shp2 In ss.Shapes
If shp2.Fill.ForeColor.RGB = RGB(255, 165, 0) Then
y = Timer + 0.1
Do While Timer < y
DoEvents
Loop
End
End If
Next shp2
End If
End If
Next shpA
Next ss
End Sub
Any help will be greatly appreciated.
Thanks
First time user of this Forum, Hopefully I can get some help on this.
THE REQUIREMENT:
I have a PowerPoint page with 4 squares (from autoshapes). Each square has some text in it which I have set to appear one after the other in each of the boxes upon mouse click using custom animation tools.
Once the text appears, I have an Action Setting on each box for a MACRO to run on each of the boxes upon click of the box. The Macro (in VBA seen below) is expected to change the color of the box to orange first. If the box selected is the correct one, the color of that box changes to green. If the box selected is incorrect, the color of the correct box should turn green.
THE ISSUE:
The Problem I am facing is that since I am bringing in the text into the boxes VIA custom Animation, when the Macro runs on the box, the color changes correctly, but the text in all the boxes disappears.
If however, I do not use custom Animation to bring in the text, everything works as it is suppposed to. But my requirements is to being in the text into the boxes one by one.
SAMPLE CODE FOR THE COLOR CHANGE:
Sub SelectAnswer1(shpA As Shape)
Dim shp2 As Shape
Dim ss As Slide
shpA.Fill.ForeColor.RGB = RGB(255, 165, 0)
For Each ss In ActivePresentation.Slides
For Each shpA In ss.Shapes
If shpA.HasTextFrame Then
If StrComp(shpA.TextFrame.TextRange, "Text1", vbTextCompare) = 0 Then
shpA.Fill.ForeColor.RGB = RGB(124, 242, 0)
For Each shp2 In ss.Shapes
If shp2.Fill.ForeColor.RGB = RGB(255, 165, 0) Then
y = Timer + 0.1
Do While Timer < y
DoEvents
Loop
End
End If
Next shp2
End If
End If
Next shpA
Next ss
End Sub
Any help will be greatly appreciated.
Thanks