Post by 54admin, 2009-5-8, Views:575 1: 对项目添加引用,Microsoft Word 11.0 Object Library 2: 在程序中添加 using Word = Microsoft.Office.Interop.Word; 3: 程序中添加 Word.Application app = new Microsoft.Office.Interop.Word.Application(); //可以打开word程序 Word.Document doc =
内容和表格内容一起读: word内容: 代码: public static void ReadWordByOpenXml(string path) { using (WordprocessingDocument doc = WordprocessingDocument.Open(path, true)) { Body body = doc.MainDocumentPart.Document.Body; foreach (var inst in body.Elements<OpenXmlEleme