创建隔离的Interop.Word实例 [英] Create isolated Interop.Word instance
问题描述
我需要通过Interop.Word在后台创建文档.当我获得_Application的新实例时,它将使用svchost.exe进程作为父进程创建新的WINWORD进程,并将Window可见性设置为Hidden. 但是,当我手动打开Word文档时,它会在App创建的进程中打开,而不是在新进程中打开.此外,它还使隐藏的Word应用程序以及在后台更早打开的所有文档可见.
I need to create documents in background via Interop.Word. When I get new instance of _Application, it creates new WINWORD process with svchost.exe process as parent and sets Window visibility to Hidden. But when I open Word document manually, it opens in a process created by App, but not in a new process. Also it makes hidden Word app with all opened documents in background earlier visible.
是否可以拒绝我在代码中创建的Word应用程序使用用户手动打开/创建的文档,并使用explorer.exe进程作为父进程来创建新的WINWORD进程,而不是使用现有的进程?
Is it possible to deny Word app created by me in code to use documents opened\created by user manually and create new WINWORD process with explorer.exe process as parent instead of using an existing one?
UPD:
解决方法: http://support.microsoft.com/kb/188546
推荐答案
替代方法为手动打开的文档创建了新的WINWORD流程: http://support.microsoft.com/kb/188546
Workaround in the link above creates new WINWORD process for the documents opened manually: http://support.microsoft.com/kb/188546
这篇关于创建隔离的Interop.Word实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!