Word文档读取速度非常慢

时间:2013-03-30 20:25:45

标签: c# performance ms-word vsto

我用MS Interop lib阅读word文档。但50页文字文件逐字阅读30分钟

我的代码:

var app = new ApplicationClass();
object file = filePath;
object nullobject = Missing.Value;

var doc = app.Documents.Open
    (ref file, ref nullobject, ref nullobject, ref nullobject,
    ref nullobject, ref nullobject, ref nullobject, ref nullobject,
    ref nullobject, ref nullobject, ref nullobject, ref nullobject,
    ref nullobject, ref nullobject, ref nullobject, ref nullobject);

doc.ActiveWindow.Selection.WholeStory();
doc.ActiveWindow.Selection.Copy();
app.Visible = false;

0 个答案:

没有答案