I've done some reading about reading from and writing to a Word doc. The reading from worked without issue:
string strPath = "Test.doc";
FileStream fStream = new FileStream
(strPath, FileMode.Open, FileAccess.Read);
StreamReader sReader = new StreamReader(fStream);
string text = sReader.ReadToEnd();
But of course this is just a string, without any formatting information included. Writing to the document using a StreamWriter worked, but I received errors when opening the document.
I've also read that trying to perform actions on an Office document on a server without the Office products installed on it can result in mayhem. I'm working on a MVC application that will allow users to upload documents to the server, work on them, save their work and email it around. That doesn't specifically require the need to read/write programmatically, but for certain application functions I do need this. Any helpful suggestions are appreciated.
View Complete Post