如何通过 Office Automation 查找并关闭打开的 Office 文档

发布于 2024-10-01 03:59:34 字数 148 浏览 0 评论 0原文

我有一个程序可以将目录中的文件上传到服务器。如果该文件是Word文件,我想检测该文件是否在word/excel等中打开。如果它打开,我希望能够关闭它,以便删除该文件的本地副本文件。

有什么想法如何做到这一点?负责检测和关闭文档的程序是一个win forms应用程序。

I have a program that will take the files in a directory and upload them to a server. If the file is a Word File, I would then like to detect if the file is open in word / excel etc. If it is open, I would like to be able to then close it, in order to delete the local copy of the file.

Any ideas how to do this? The program responsible for the detection and closing of the documents is a win forms app.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文