如何通过 Office Automation 查找并关闭打开的 Office 文档
我有一个程序可以将目录中的文件上传到服务器。如果该文件是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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许如何使用 Visual C# 自动运行 Office 程序实例
Perhaps How to use Visual C# to automate a running instance of an Office program