title: How to do a Mail Merge in C# using Interop.Word?
body: <p>I have a template in Word that would be used to print out invoices.</p>
  
  <p>Now, I would like to know how to create a Word Document programmatically and copy the template content into the new document so that I still have a clean template, then replace placeholders that I have typed by using Mail.Merge. I found similar Mail.Merge questions but most require Spire components and I am not interested since it needs to be paid for. I am only a student. Others though, actually doesn't help that much.</p>
  
  <p>The problems I am facing now are as follows:</p>
  
  <ol>
  <li>Create a Word document</li>
  <li>Copy template content into new document</li>
  <li>How to add placeholder names into <code>MailMerge</code> since I'm very confused about this.</li>
  <li>Do <code>MailMerge</code></li>
  </ol>
  
  <p>Here is the current code that I have concocted, this is actually the first time I have used Interops</p>
  
  <pre><code>Document document = new Document();
  Microsoft.Office.Interop.Word.Application wordApp = new Microsoft.Office.Interop.Word.Application();
  document = wordApp.Documents.Open(fileName);
  string[] fieldNames = {"date_issued", "month_covered", "tuition", "lunchfee", "discount", "in_no", "student_no", "student_name", "amount_due", "amount_paid", "balance", "penalty", "status"};
  string[] data = new string[25];
  Range range;
  document.MailMerge.Fields.Add(range, fieldNames[0]);
  document.MailMerge.Execute();
  </code></pre>
  
  <p>I'm really confused on this part </p>
  
  <pre><code>document.MailMerge.Fields.Add(range, fieldNames[0]);
  </code></pre>
  
  <p>and I don't know what <code>range</code> is for</p>