Click here to Skip to main content
12,622,535 members (32,652 online)
Click here to Skip to main content
Add your own
alternative version


46 bookmarked

MS Word 2003 XML Output

, 29 Feb 2004
Rate this:
Please Sign up or sign in to vote.
How to give a Word output without MS Office Web Components (OWC) on the server.


Word 2003 in client's PC.


We generally give an HTML output to the browser to display results. Now we can give a Word output without MS Office Web Components (OWC) on the server.

Using the code

Any application, whether it is running on Microsoft or Java technologies, can stream out MS Word compatible XML. schema needs to be used. Users can use Microsoft or Java technologies to give an output, by just following the XML Schema Reference.

I am using Customers table in the Northwind database. Below is a code-behind code in C# for generating Word document in XML. Remove any HTML tag from the aspx page, only the Page directive should be there.

using System; 
using System.Collections; 
using System.ComponentModel; 
using System.Data; 
using System.Data.SqlClient; 
using System.Web; 
using System.Text; 
using System.Web.SessionState; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
using System.Web.UI.HtmlControls; 

namespace Word2003 
    /// <span class="code-SummaryComment"><summary> 


If Word 2003 is installed, then it will open up and display the data. If Word 2003 is not available on the client, XML will be displayed in the browser. Microsoft Office 2003 XML Reference Schemas are available for download here.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Web Developer
India India
I am working as Technical Lead at Virtusa, Hyderabad, India. I have more than 6 yrs of experience on the Microsoft Web Platform. I have been working in and out DotNet Technology since Pre Beta Release. The articles are the outcome of the R&D I do in my freetime.

You may also be interested in...

Comments and Discussions

Questionrecord with & Pin
rodchar8-Dec-06 6:54
memberrodchar8-Dec-06 6:54 
AnswerRe: record with & Pin
Charles E. Wagner Jr.5-Jan-07 9:44
memberCharles E. Wagner Jr.5-Jan-07 9:44 
GeneralConversion of ASP to MS Word Pin
Vishnu_vardhan18-Jun-05 9:00
memberVishnu_vardhan18-Jun-05 9:00 
GeneralThank you for available Code Pin
nattapat7-Jun-05 0:00
membernattapat7-Jun-05 0:00 
GeneralGreat work Pin
Venkat Eswaran21-Dec-04 20:36
memberVenkat Eswaran21-Dec-04 20:36 
GeneralOn a theme Pin
Anonymous27-Apr-04 0:16
sussAnonymous27-Apr-04 0:16 
QuestionWhat about Word 2002 ? Pin
Braulio Díez22-Mar-04 1:51
memberBraulio Díez22-Mar-04 1:51 
AnswerRe: What about Word 2002 ? Pin
Karthikg22-Mar-04 2:53
memberKarthikg22-Mar-04 2:53 
GeneralInteresting, thanks Pin
Steven Campbell1-Mar-04 12:41
memberSteven Campbell1-Mar-04 12:41 
GeneralWord 2003 xml Pin
Stephane Rodriguez.29-Feb-04 23:07
memberStephane Rodriguez.29-Feb-04 23:07 
GeneralRe: Word 2003 xml Pin
Abdul (Rajib) Bahar26-Apr-04 12:53
memberAbdul (Rajib) Bahar26-Apr-04 12:53 
GeneralMS Word View 2003 Pin
markpers12-Jan-05 22:39
membermarkpers12-Jan-05 22:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.161128.1 | Last Updated 1 Mar 2004
Article Copyright 2004 by Karthikg
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid