title: Change Margins on HTML export to Word
body: <p>The actual export is no problem: </p>
  
  <pre><code>Response.Clear();
  Response.ClearHeaders();
  Response.Buffer = true;
  Response.ContentType = "application/msword";
  Response.AddHeader("Pragma", "public");
  Response.AddHeader("Expires", "0");
  Response.AddHeader("Content-Type", "application/word");
  Response.AddHeader("content-disposition", String.Format("attachment;filename={0}.doc", docName));
  Response.Charset = "utf-8";
  StringWriter sw = new StringWriter();
  HtmlTextWriter hw = new HtmlTextWriter(sw);
  mainbody.RenderControl(hw);
  Response.Output.Write(sw.ToString());
  Response.Flush();
  Response.End();
  </code></pre>
  
  <p>So my question is: How do I change the margins on the resulting word doc?</p>
  
  <p>If I open the downloaded word doc then save as HTML, the directive that defines the margins is: </p>
  
  <pre><code>@page WordSection1
  {
    size:8.5in 11.0in;
    margin:1.0in 1.0in 1.0in 1.0in;
    mso-header-margin:.5in;
    mso-footer-margin:.5in;
    mso-paper-source:0;
  }    
  </code></pre>
  
  <p>I'm wondering how I can change this in the response headers so I can output the form correctly on one sheet.  Any ideas?</p>