简体   繁体   English

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

[英]How to Find and Close an open Office document via Office Automation

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. 如果该文件是Word文件,则我想检测该文件是否已在word / excel等中打开。如果已打开,则我希望能够将其关闭,以删除该文件的本地副本。文件。

Any ideas how to do this? 任何想法如何做到这一点? The program responsible for the detection and closing of the documents is a win forms app. 负责检测和关闭文档的程序是一个Win Forms应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM