title: Programmatically insert data to word file and save in asp.net
body: <p>i have one asp.net application , and i want to insert header and some text to word file programmatically. then insert gridview data in same word file and then save here is code</p>
  
  <pre><code>protected void btnPrint_Click(object sender, EventArgs e)
  {
      GridView1.AllowPaging = false;
      GridView1.DataBind();
      Response.ClearContent();
      Response.AddHeader("content-disposition", string.Format("attachment; filename={0}", "Customers.doc"));
      Response.Charset = "";
      Response.ContentType = "application/ms-word";
      StringWriter sw = new StringWriter();
      HtmlTextWriter htw = new HtmlTextWriter(sw);
      GridView1.RenderControl(htw);
      Response.Write(sw.ToString());
      Response.End();
  
  
  
  }
  </code></pre>
  
  <p>now , gridview data is  inserting in that word doc file, but before gridview i want insert some text in to same file, 
   please help......</p>