title: Export HTML to MS WORD docx file in ASP.NET
body: <p>I want to export html Table on my aspx page to MS WORD (<b>.docx</b>) file. 
  I already have code to export <b>.doc</b> file but I want to Export in docx extension.</p>
  
  <pre><code>protected void btnExport_Click(object sender, EventArgs e)
  {
      Response.Clear();
      Response.Buffer = true;
      Response.ContentType = "application/vnd.openxmlformatsofficedocument.wordprocessingml.documet";
      Response.AddHeader("Content-Disposition", "attachment; filename=WORK_ORDER.doc");
      Response.ContentEncoding = System.Text.Encoding.UTF8;
      Response.Charset = "";
      EnableViewState = false;
      System.IO.StringWriter writer = new System.IO.StringWriter();
      System.Web.UI.HtmlTextWriter html = new System.Web.UI.HtmlTextWriter(writer);
      xx.RenderControl(html);
      Response.Write(writer);
      Response.End();
  }      
  </code></pre>