473,395 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

msword document in asp.net

Hi,

I created a msword doc using asp.net with stringwriter and htmltextwriter.

now i want to add the header and footer ..in the header the page no should be there and in the footer document name should be there...

how can i do this ..

Ramesh d
Jul 12 '07 #1
2 1324
radcaesar
759 Expert 512MB
You have to use Office Component to achieve this. How can u create word file using StringWriter()
Jul 12 '07 #2
i did like this

Response.Clear();
Response.Buffer= true;

System.IO.StringWriter oStringWriter = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);


Response.AddHeader("Content-Disposition", "attachment;filename="+sowdocname+".doc");
Response.ContentType = "application/vnd.ms-word";
Response.Charset = "";
this.EnableViewState = false;

Page.RenderControl(oHtmlTextWriter);

Response.Write(oStringWriter.ToString());
Response.End();
Jul 12 '07 #3

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

Similar topics

0
by: staleb | last post by:
Hi We have a application solution set up like this. A Web-server,db-server and a document server. The web-server comunicates with the two other servers. When the user uses our application he...
1
by: Eilsa | last post by:
I want to perform a full-text search for a lot of MSWord documents. So that I have to read the MSWord content and store it to the database. However, I cannot find any solution on it. What should I...
0
by: staleb | last post by:
Hi I want to open a MSWord document on the clients PC/MSWord, the solution I use now is this: <script language=vbscript runat=Server> <!-- sub OpenDoc(strLocation) set objWord =...
2
by: Guillaume Durand | last post by:
Hi, I transform XML data in an OutputStream which is open as a word document. All works fine excepted the images defined in the xsl file which are html links (src="images/image1.jpg"). So, when...
7
by: lkr | last post by:
hi is there is anyway to capture the document events of a MSWord?eg:I have to handle the event awhen WM_KEYUP or anyother events will occur. give me a solution............ thanks in advance lkr
1
by: Jason Huang | last post by:
Hi, I have no problem in creating or modifying a word document in ASP.Net, using C#. However, I don't know how to export database in SQL 2000 or MSAccess to MSWord, given in the ASP.Net and C#...
5
by: Y.A. | last post by:
I want to start msWord on the server with an a givene file (.doc), customize the file (update it) then display it on the client machine -- all this on intranet using asp.net. I know it's doable...
6
by: Peter | last post by:
I have to write a ASP.NET application that creates MSWord document from a template and populated with data from the webpage. (Templates can reside on the server or client's hard drive.) What is...
0
by: Staleb | last post by:
Hi I am using VS2003 and vb.net in my procject. One of my functions is to produce a MSWord on the Web-server, and through a VB-script save it localy on the clients computer. The problem is...
1
by: Matt Curreri | last post by:
I'm trying to automate the creation of a MSWord document with C#; however, when I start creating the MSWord document, I occassionly have a MSWord dialog box displaying a warning of low memory and...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
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...

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.