title: Finding a Content Control in Word based on Tagname
body: <p>I'm currenty trying some new things with OpenXml but I recently came across some trouble. As the title says I'm trying to insert data dynamically into a table using Xml. To indentify the table in my Worddoc I've put a Rich Text Content Control arround it.</p>
  
  <p>Everything worked &amp; looked fine until I tried to search my document for the tagname of the Rich Text Content Control. I keep getting a "<em>Object reference not set to an instance of an object.</em>" while running my code.</p>
  
  <p>He's the line where it happens:</p>
  
  <pre><code>SdtBlock ccWithTable = mainPart.Document.Body.Descendants&lt;SdtBlock&gt;().Where(r =&gt; r.SdtProperties.GetFirstChild&lt;Tag&gt;().Val == t.Name).Single();
  </code></pre>
  
  <p>I've used following MSDN document to try and achieve my goal, without succes:</p>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/cc197932.aspx" rel="nofollow noreferrer">Inserting Repeating Data Items into a Word 2007 Table by Using the Open Xml API</a></p>
  
  <p>If anyone can help me, I would love you long time.</p>