110,535
社区成员
发帖
与我相关
我的任务
分享
string path = openFileDialog1.FileName;
Word.ApplicationClass Word_App = new Word.ApplicationClass();
object fileobj = path;
object nullobj = System.Reflection.Missing.Value;
Word.Document wd = Word_App.Documents.Open(ref fileobj, ref nullobj, ref nullobj, ref nullobj,
ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj,
ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj,
ref nullobj, ref nullobj);
textBox1.Text = wd.Content.Text;
wd.Close(ref nullobj, ref nullobj, ref nullobj);
Word_App.Quit(ref nullobj, ref nullobj, ref nullobj);