title: How to insert table into Word document in place of text mark?
body: <p>I have <code>DateTable</code>. Need to insert it instead of some set of characters in teplate document.</p>
  
  <p>I can replace text-to-text this way (lots of missingObj to avoid the bugs):</p>
  
  <pre><code>    using Word = Microsoft.Office.Interop.Word;
  
      Word._Application application;
      Word._Document document;
      Object missingObj = System.Reflection.Missing.Value;
      Object trueObj = true;
      Object falseObj = false;
  
      private void create_button1_Click(object sender, EventArgs e) {
              application = new Word.Application();
              Object templatePathObj;
              templatePathObj = "template.dot";  
  
              try {
                  document = application.Documents.Add(ref  templatePathObj, 
                      ref missingObj, ref missingObj, ref missingObj);
              }
              catch (Exception error) {
                  document.Close(ref falseObj, ref  missingObj, ref missingObj);
                  application.Quit(ref missingObj, ref  missingObj, ref missingObj);
                  document = null;
                  application = null;
                  throw error;
              }
  
              object strToFindObj = "%%mark%%";
              object replaceStrObj = "text to replace";
              Word.Range wordRange;
              object replaceTypeObj;
              replaceTypeObj = Word.WdReplace.wdReplaceAll;
              for (int i = 1; i &lt;= document.Sections.Count; i++) {
                  wordRange = document.Sections[i].Range;
                  Word.Find wordFindObj = wordRange.Find;
                  object[] wordFindParameters = new object[15] { strToFindObj, missingObj, 
                      missingObj, missingObj, missingObj, missingObj, missingObj, missingObj, 
                      missingObj, replaceStrObj, replaceTypeObj, missingObj, missingObj, 
                      missingObj, missingObj };
                  wordFindObj.GetType().InvokeMember("Execute", BindingFlags.InvokeMethod, 
                      null, wordFindObj, wordFindParameters);
          }
          application.Visible = true;
      }
  </code></pre>
  
  <p>What i have to change so this code will take <code>DataTable</code> instead of <code>strToFindObj</code>?</p>
  
  <p>In this example i replace stuff in <code>Range</code>, what is some fragmen of document including tables, format, etc.</p>