generate word document from  using c#

Posted on 2005-04-15
Last Modified: 2010-04-16
Can someone provide a quick example or a link to  an example showing how to create a word document from an page using c#

I am generating a report from a database, could use dataset, or datareader whatever. Need  to display in word instead of to screen. Have seen articles showing how to generate rtf files  which stream to word  but  they are coded in ASP and Vbscript, or  

Any  help  would be appreciated.
Question by:jschillm

    Author Comment

    btw, if someonoe has  a solution other than a link, i  will up  the points.
    LVL 8

    Expert Comment


    Author Comment

    I thought I saw articles that said using office automation with was not a good Idea, I think Microsoft even said it was not a good idea. I had seen articles referencing creating rtf files which can then be streamed to word, but all examples are in and not c#. Any ideas on this?
    LVL 17

    Accepted Solution


    There's a thrid part component which can be found at You can use it to gerenate documents on the fly. They also have a page up explaining the issues with both performance, security and licensing issues surrounding word automation.
    LVL 17

    Expert Comment

    Another option is to use the Crystal Reports for 2003 which comes with Visual studio. You can export reports from Crystal directly to Word.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Article by: Ivo
    Anonymous Types in C# by Ivo Stoykov Anonymous Types are useful when  we do not need to follow usual work-flow -- creating object of some type, assign some read-only values and then doing something with them. Instead we can encapsulate this read…
    This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now