472,102 Members | 2,058 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

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 5388
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 leo001 | 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.