Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Re: read a word doc line by line

Reply
Thread Tools

Re: read a word doc line by line

 
 
Robert Jacobson
Guest
Posts: n/a
 
      09-30-2003
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/de...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/usi...e/default.aspx

Microsoft Office 2000/Visual Basic Programmer's Guide
http://msdn.microsoft.com/library/de...mmersguide.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??



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
String[] files = {"a.doc, b.doc"}; VERSUS String[] files = new String[] {"a.doc, b.doc"}; Matt Java 3 09-17-2004 10:28 PM
Re: read a word doc line by line Mary Chipman ASP .Net 0 10-02-2003 02:33 AM
Re: read a word doc line by line John Timney \(Microsoft MVP\) ASP .Net 0 09-30-2003 10:38 PM
Re: read a word doc line by line Michael Giagnocavo [MVP] ASP .Net 0 09-30-2003 08:50 PM
Parsing MS Word client doc into server-side doc... John Wallace ASP .Net 0 07-22-2003 06:49 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57