处理我的MS Word自动化程序 [英] Deal with my MS Word automation program

查看:58
本文介绍了处理我的MS Word自动化程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试按照以下步骤处理MS Word自动化程序时:
1,通过新的Word.ApplicationClass()启动winword.exe进程;
2,打开.doc文件;
3,对打开的文档执行操作.
4,关闭文档,然后转到步骤2.

而且我发现winword.exe占用的内存增加了,即使在doc.Close(,,)之后也很少释放,因为该程序按上述步骤执行.这是一个问题!我该如何处理.谢谢!

When I try to deal with my MS Word automation program in the following steps:
1,Start a winword.exe process by new Word.ApplicationClass();
2,Open a .doc document;
3,Do something with the opened document.
4,Close the document,and go to step2.

And I find that the memory taken by winword.exe increases and releases little even if after the doc.Close( , , ) as the program executes as steps above.That''s a problem!how can i deal with it.thank you!

推荐答案

在关闭文档后使用此方法.

wordApp.Application.Quit(缺少引用,缺少引用,缺少引用);
Use this method after closing document.

wordApp.Application.Quit(ref missing, ref missing, ref missing);


这篇关于处理我的MS Word自动化程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆