0

When I export a page to MS Word, Word cuts off some of my data on the due to a problem with the margins. I've checked the margins under "page setup" in Access as well as in Word, but for whatever reason, Word won't use the new margin settings. As always, thanks in advance for your help.

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by amey.rane86
0

Write Response headers,

Response.Clear();
        Response.ClearHeaders();
        Response.AddHeader("Pragma", "public");
        Response.AddHeader("Expires", "0");
        Response.AddHeader("Content-Type", "application/word");
        Response.AddHeader("Content-Disposition", "inline; filename=sample.doc");
        Response.Write("<table><tr><td><h1>No</h1></td></tr></table>");
        Response.Flush();
        Response.End();
0

Write Response headers,

Response.Clear();
        Response.ClearHeaders();
        Response.AddHeader("Pragma", "public");
        Response.AddHeader("Expires", "0");
        Response.AddHeader("Content-Type", "application/word");
        Response.AddHeader("Content-Disposition", "inline; filename=sample.doc");
        Response.Write("<table><tr><td><h1>No</h1></td></tr></table>");
        Response.Flush();
        Response.End();

hi i tried dat bt der is problem with margin

string style = "<style>body {margin-top: 100px; margin-right: 40px; margin-bottom: 10px; margin-left: 70px;}</style>";

Response.Clear();

Response.AddHeader("content-disposition", "attachment;filename=BabulEnterprises" + ".doc");

Response.Charset = "";

// Response.Cache.SetCacheability(HttpCacheability.NoCache);

Response.AppendHeader("Content-Type", "application/msword");

StringWriter stringWrite = new StringWriter();

HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);


Response.Write(style);

pnlForm.RenderControl(htmlWrite);

Response.Write(stringWrite.ToString());

Response.End();

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.