1、添加COM引用:Microsoft Word 12.0 Object Library
2、
using Microsoft.Office.Interop.Word3、
string filePath = System.IO.Directory.GetCurrentDirectory();
object fileName = filePath + "\\" + "x.doc";//args[0];
object pw = "123";
object oMissing = Type.Missing;
Application wordApp = new Application();
Document doc = new Document();
doc = wordApp.Documents.Open(ref fileName, ref oMissing, ref oMissing, ref oMissing,
ref pw, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing);
1万+

被折叠的 条评论
为什么被折叠?



