jacob读取word速度优化
jacob读取word速度优化
我所遇到的读取速度慢的原因在于读取word后关闭本地线程速度过慢,所以创建静态对象,线程不关闭,多次读取使⽤同⼀线程代码如下
public static MSWordManager msWordManager = new MSWordManager();
public static MSWordManager getMSWordManager(){
if(msWordManager == null){
return new MSWordManager();
}
if(msWordManager.documents == null){
msWordManager.documents = Property(“Documents”).toDispatch();
}
return msWordManager;
}
public static MSWordManager writeMSWordManager = new MSWordManager();
public static MSWordManager getWriteMSWordManager(){
if(writeMSWordManager == null){汇报总结
return new MSWordManager();
怎么写读后感}
if(writeMSWordManager.documents == null){
writeMSWordManager.documents = Property("Documents").toDispatch();
形容气势大的词语
}
return writeMSWordManager;
}北京旅游攻略必去景点
适合雨天的心情的句子
读取⽂档后⽤如下⽅法关闭⽂档
public void easyClosed(){
if (doc != null) {
Dispatch.call(doc, “Save”);
Dispatch.call(doc, “Close”, new Variant(saveOnExit));
ipad充电慢是什么原因doc = null;
}
documents = null;
}

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。