469,299 Members | 2,079 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,299 developers. It's quick & easy.

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 1435

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
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.