title: OpenXML table copy gives OpenXmlUnknownElement
body: <p>I'm using OpenXML SDK with Word to produce labels. The base Word doc has one page with a table, two rows and two cells where each cell represents one label. My plan was to add pages as needed based on the size of a SQL result set. The append of the page works but the count of tables in the Body doesn't change. Is there a way to refresh the Element array? I suppose I can get the size of the result set and append the required number of pages then close and reopen the doc but I'm guessing I'm missing something simple.</p>
  
  <p><strong>Reported the wrong problem</strong> sorry, the doc looked correct in Word but not in the productivity tool. I updated the code to show my latest attempt. iTest now reports the correct number of tables but in the productivity tool the added tables are flagged as <em>OpenXmlUnknownElement</em>.</p>
  
  <pre><code>for (int i = 0; i &lt; pages; ++i)
  {
      Table table = new Table(doc.MainDocumentPart.Document.Body.Elements&lt;Table&gt;().First().CloneNode(true));
      doc.MainDocumentPart.Document.Body.Append(table);
  }
  int iTest = doc.MainDocumentPart.Document.Body.Elements&lt;Table&gt;().Count();
  </code></pre>
  
  <p>the xml shows there is an extra <code>&lt;w:tbl&gt;</code> generated:</p>
  
  <pre><code>&lt;w:tbl xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"&gt;
    &lt;w:tbl&gt;
      &lt;w:tblPr&gt;
        &lt;w:tblStyle w:val="TableGrid" /&gt;
  </code></pre>
  
  <p>So the real question is, how to copy and paste a table with OpenXML SDK?</p>