Do you mean a MS Word document or a text document. If you want to read a
text document the following is the snippet, you could
string path = @"c:\temp\temp.txt";
// This text is added only once to the file.
if (!File.Exists(path))
throw new FileNotFoundException("File not found");
// Open the file to read from to read line by line and storing it
in an array.
string[] readText = File.ReadAllLines(path);
foreach (string s in readText)
Console.WriteLine(s);
// Open the file to read from to read the entire contents into a
string
string text = File.ReadAllText(path);
Console.WriteLine(text);
-Arun
How can I read a word file from C#?
I need to process each word of the document for a work.
Thank you.