471,595 Members | 984 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,595 software developers and data experts.

export to msword - html

hi guys I'm trying to export an aspx page to msword.

#############

I know you can do

Response.Clear();

Response.ContentType="application/msword";

Response.AddHeader("Content-disposition",

"attachment; filename=myword.doc");

Response.Charset = "";

StringWriter sw = new StringWriter();

HtmlTextWriter htw = new HtmlTextWriter(sw);

this.Label1.RenderControl(htw);

Response.Write(sw.ToString());

Response.End();

#################

and render a control to msword. the problem is when I do this to render the
label the HTML is not converted to word xml when the ms word opens.

I assumed that it would be based on the same principle as opening a html
file in msword where word automatically converts the html file to word
format.

is it possible to do this ? atm the html is rendered as text too so I get a

<span id="Label1">test</span>

instead of just "test"

Thanks

Tom
Jul 21 '05 #1
0 1513

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Guillaume Durand | last post: by
reply views Thread by Tom Gao | last post: by
1 post views Thread by Cloud | last post: by
reply views Thread by Anwar ali | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.