title: For Each Loop - Text from color X to Y
body: <p>I'm making a rudimentary game in PPT using VBA for work. One of the components is a personality test with multiple choice questions. The way I have decided to do this is to have the four answers as separate text boxes, default color of black. When any text block is clicked, it will change the text in that textblock to red, and turn all other text blocks to black, so that only 1 text block is ever red at a time. A button at the bottom will determine which textbox has red text, and based off that save a variable in an array that will go into calculating the personality type.</p>
  
  <p>Right now, I'd like a loop statement that runs through a single slide to evaluate the text. Later on i'll modify it to accept a passed-in slide number (So I can use the function on every slide with questions). I'm not even worried about the if statement to decide when to swap color, I can't even get the loop to simply change ALL text (which should be so simple...)</p>
  
  <p>As I see it, the loop needs to:
  1) Check every object in a single pre-determined slide to see if it has text
  2) Change the color of all text to a color entered in the code.</p>
  
  <p>'''
  Sub fontChangeWhy()</p>
  
  <pre><code>Dim oSl As Slide
  Dim oSh As Shape
  
  
  oSl = ActivePresentation.Slides(2)
  
      For Each oSh In oSl.Shapes
          If oSh.HasTextFrame Then
              If oSh.TextFrame.HasText Then
                  oSh.TextFrame.TextRange.Font.Color.RGB = RGB(0, 0, 0)
              End If
          End If
      Next oSh
  </code></pre>
  
  <p>End Sub
  '''</p>