Re: read a word doc line by line

Discussion in 'ASP .Net' started by Robert Jacobson, Sep 30, 2003.

  1. Sara,

    Do you mean that you want to read the text that's contained in a Microsoft
    Word file? The Microsoft Word file format is a propietary binary format.
    Although you could read the raw bytes using System.IO.Streamreader, they
    wouldn't be very meaningful.

    The simplest thing would be to work with plain text files. For example, you
    could manually open the file in Word and use "save as" to convert it to
    plain text. (Of course, you'll lose all the formatting in the new file.)
    Then you could use StreamReader or TextReader to read each line.

    If you need to read unconverted Microoft Word documents, you'll need to use
    Microsoft Word Automation. You can programatically create a new instance of
    Microsoft Word, open a Word document, and then retrieve the text of the
    active Word document (or smaller chunks of text) by using the Microsoft Word
    Range object.

    Here are some resources to get you started:

    Understanding the Word Object Model from a .NET Developer's Perspective
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_vsto2003_ta/html/wordobject.asp

    INFO: Develop Microsoft Office Solutions with Visual Studio .NET
    http://support.microsoft.com/?kbid=311452

    HOWTO: Use Automation to Get and to Set Office Document Properties with
    Visual Basic .NET
    http://support.microsoft.com/?kbid=303294

    Office Development
    http://msdn.microsoft.com/vbasic/using/building/office/default.aspx

    Microsoft Office 2000/Visual Basic Programmer's Guide
    http://msdn.microsoft.com/library/d...eovroffice2000visualbasicprogrammersguide.asp


    "sara" <> wrote in message
    news:0e2c01c38775$05bb7300$...
    > I have a .net applicationa and need to read a word
    > document line by line. I need to parse certain lines into
    > certain fields of the database. I Haven't a clue how to do
    > this.
    >
    > Can anyone help please??
    Robert Jacobson, Sep 30, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Wallace
    Replies:
    0
    Views:
    456
    John Wallace
    Jul 22, 2003
  2. Michael Giagnocavo [MVP]

    Re: read a word doc line by line

    Michael Giagnocavo [MVP], Sep 30, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    359
    Michael Giagnocavo [MVP]
    Sep 30, 2003
  3. John Timney \(Microsoft MVP\)

    Re: read a word doc line by line

    John Timney \(Microsoft MVP\), Sep 30, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    495
    John Timney \(Microsoft MVP\)
    Sep 30, 2003
  4. Mary Chipman

    Re: read a word doc line by line

    Mary Chipman, Oct 2, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    398
    Mary Chipman
    Oct 2, 2003
  5. Matt
    Replies:
    3
    Views:
    478
    Tor Iver Wilhelmsen
    Sep 17, 2004
Loading...

Share This Page