title: Change font color in OpenXML word document (C#)
body: <p>I've been searching for hours and I just can't seem to find a solid answer for this.  I have an existing document with content controls that I need to edit the text in with external data.  If the data for one of the controls is not present, then I need to replace the text with an appropriate notice and change the font color.</p>
  
  <p>I have the text entry and all that working just fine, the only part that won't seem to do its job is changing the font color.  The current code I have doesn't give me any errors and is running through this method just fine, but when I look at the finished document its still the plain black text.</p>
  
  <p>My color changing method: (the input is a list of all content controls with the same tag)</p>
  
  <pre><code>public void SetBlueText(List&lt;SdtElement&gt; sdtElement)
  {
      foreach (SdtElement element in sdtElement)
      {
          if (element != null)
          {
              RunProperties runProperties = element.Descendants&lt;RunProperties&gt;().FirstOrDefault();
              runProperties.Color = new DocumentFormat.OpenXml.Wordprocessing.Color() { Val = "0EBFE9" };
          }
      }
  }
  </code></pre>
  
  <p>Also, simplifying those two lines down to just this / has the same effect</p>
  
  <pre><code>element.Descendants&lt;RunProperties&gt;().FirstOrDefault().Color = 
                          new DocumentFormat.OpenXml.Wordprocessing.Color() { Val = "0EBFE9" };
  </code></pre>