分类：电脑/网络-程序设计
问题：如何利用C#从WORD中读取内容并存入数据库 
回答：前提： 导入COM库：Microsoft word 11.0 Object Library. 引用里面就增加了： 打开: object oMissing = System.Reflection.Missing.Value; Word._Application oWord; Word._Document oDoc; oWord = new Word.Application(); oWord.Visible = true; object fileName = @"E: c"; oDoc = oWord.Documents.Open(ref fileName, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing); 导入模板 object oMissing = System.Reflection.Missing.Value; Word._Application oWord; Word._Document oDoc; oWord = new Word.Application(); oWord.Visible = true; object fileName = @"E: c"; oDoc = oWord.Documents.Add(ref fileName, ref oMissing, ref oMissing, ref oMissing);