473,474 Members | 1,836 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

4 New Member
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 5478
robbie12345
1 New Member
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

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

Similar topics

2
by: RickL | last post by:
I have an ASP application that uploads a specified file to the server. To retrieve the file, I simply assign the filepath and file to a hyperlink on the page. When you click "Save Target As" for...
5
by: kevin | last post by:
Hi, Any help with this would be really appreciated! I'm trying to download a file from a remote server. The access permissions is okay but the problem I'm facing is that the file is getting...
4
by: sunilj20 | last post by:
Hello, I have a requirement wherein, a user clicks on a file name in an ASP.NET web application, and the file should automatically be downloaded (Without showing the "Open", "Save As") in the...
2
by: zheng | last post by:
ÇçÌì I have a word document and it has a picture object, I want save the picture object as other single picture file by C# program. I have a idea, by clipboard, copy the picture to clipboard, and...
4
by: teeBull | last post by:
Hi all, We'd like to take advantage of code we already have for transforming XML into HTML (using XSLT) for our users to save the HTML as an MS Word document locally. I've dug around and found...
2
by: Simon Wigzell | last post by:
I have inherited a database driven website that comes with a table of image links. The images are scattered all of the internet and there are thousands of them. I would like to write an asp script...
7
by: Mads Aggerholm | last post by:
Hello Sirs, I am having a BMP loadet into a picturebox. This I'd like to save on my harddisk as a GIF: picturebox1.Image.Save("C:\\DATA\\PICTURES\\testpic.gif", ImageFormat.Gif); However,...
3
by: evenlater | last post by:
I have an Access application on a terminal server. Sometimes my users need to export reports to pdf, rtf or xls files and save them to their own client device hard drives. They can do that right...
0
by: talk2pk | last post by:
When i am writing the images to the word file(using Clipboard.SetImage) and open another word doc, the process of writing those images migrates to the new opened document. Can anybody suggest why...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.