现象:同时启动了多个word的exe,word退出的时候,会报警告“此文件正由另一个应用程序或用户使用”。
原因:多个word exe不能用时用.dot模板
解决:Word退出代码(C#)
Word_doc.SaveAs(ref savePath, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing); //避免弹出normal.dot被使用的对话框 Word_App.NormalTemplate.Saved = true; //关闭Word Word_doc.Close(ref oMissing, ref oMissing, ref oMissing); Word_App.Quit(ref oMissing, ref oMissing, ref oMissing);
本文介绍了一种解决在同时运行多个Word实例时,因.dot模板被占用而引发的警告问题的方法。通过设置NormalTemplate的Saved属性为true,并正确关闭Word文档和应用程序,可以避免弹出normal.dot被使用的对话框。
1万+

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



