469,958 Members | 2,120 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

How to Save images in ms word file when it is downloaded from asp.net application

Hi,
How to Save images in ms word file when it is downloaded from asp.net application. I have used the following code to convert the html page into ms word file. but i'm not able to save the images from html to doc file. Please suggest me how to save an image from a html to doc file.

I have used the following Code to convert HTML into doc file:

Response.Clear();
Response.Buffer = true;
Response.ContentType = "application/vnd.ms-word";
Response.AddHeader("Content-Disposition","attachment; filename="+Request.QueryString["SetNo"].ToString()+".doc");

StringBuilder str = new StringBuilder();

str.Append("<table cellpaddin=0 cellspacing=0 border=0 width=100%>");
str.Append("<tr>");
str.Append("<td align=center>");
str.Append("<img src='../Images/Img1.gif' border='0'>");
str.Append("</td>");
str.Append("</tr>");
str.Append("</table>");
Response.write(str.toString());
May 8 '06 #1
1 5296
Hi,
How to Save images in ms word file when it is downloaded from asp.net application. I have used the following code to convert the html page into ms word file. but i'm not able to save the images from html to doc file. Please suggest me how to save an image from a html to doc file.

I have used the following Code to convert HTML into doc file:

Response.Clear();
Response.Buffer = true;
Response.ContentType = "application/vnd.ms-word";
Response.AddHeader("Content-Disposition","attachment; filename="+Request.QueryString["SetNo"].ToString()+".doc");

StringBuilder str = new StringBuilder();

str.Append("<table cellpaddin=0 cellspacing=0 border=0 width=100%>");
str.Append("<tr>");
str.Append("<td align=center>");
str.Append("<img src='../Images/Img1.gif' border='0'>");
str.Append("</td>");
str.Append("</tr>");
str.Append("</table>");
Response.write(str.toString());
I have got the same problem... have you found an answer for this problem yet?
Nov 13 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by sunilj20 | last post: by
4 posts views Thread by teeBull | last post: by
7 posts views Thread by Mads Aggerholm | last post: by
reply views Thread by rainxy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.