|
Object Nothing = System.Reflection.Missing.Value;
// Get Word file save path
object filename = "E: / site // New Microsoft Word document.doc";
// Create a component object named WordApp
Word.Application WordApp = new Word.ApplicationClass ();
// Open the document object
WordApp.Documents .Open (ref filename, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing , ref Nothing);
this.read_tb .Text = WordApp.MailMessage .ToString ();
// Save
WordApp.ActiveDocument.SaveAs2000 (ref filename, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing);
//shut down
WordApp.ActiveDocument.Close (ref Nothing, ref Nothing, ref Nothing);
WordApp.Quit (ref Nothing, ref Nothing, ref Nothing);
-------------------------------
Still can't read it |
|