Read word document

  • Thread starter Thread starter livinginmatrix
  • Start date Start date
L

livinginmatrix

Hi, forum

i have all the necessary code to open a word file but i
need the sentence to read the text of the word file, to
convert it into a text file...

Thanks in advance.
Newbie
 
I'm not sure how you're openning up the word doc, but it
sounds like you just need a string of the doc's text...
here's a quick and dirty way:

System.IO.StreamWriter sw = new System.IO.StreamWriter
("MyTextFile.txt");
richTextBox1.LoadFile("MyWordDoc.doc");
sw.Write(richTextBox1.Text);
sw.Close();

You'll need to create a RichTextBox control.
-Fabricio
 
Back
Top