Application.Run启动另一个Word进程 [英] Application.Run starts another Word process

查看:102
本文介绍了Application.Run启动另一个Word进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几天前一切正常。

我的Autostart文件夹中有一个模板,它做了一些事情,然后加载另一个模板并从中调用一个函数它:

I have a template in my Autostart folder, that does some things and then load another template and call a function from it:

AddIns.Add "TemplateName", True
Application.Run "FunctionName"

当运行此代码时,我得到MessageBox,说我无法保存Normal.dotm。事实证明,它是由Winword的第二个进程引起的 - 第二个进程无法保存normal.dotm,因为它是由第一个进程保存的。但第二个过程是如何开始的?b $ b的?调试显示它是由Application.Run启动的!

When this code was run I got MessageBox saying I can't save Normal.dotm. As it turns out, it was caused by second process of Winword - this second process couldn't save normal.dotm because it was held by first process. But how did the second process got started? Debugging showed that it is started by Application.Run!

我打开了两个模板并设置了断点 - 第一个在Application.Run上,第二个在"FunctionName"中。奇怪的事情发生 - 在执行Application.Run之后,第二个进程在任务管理器中进行,并且模板已关闭。我从来没有
到达第二个断点,因为它是从另一个进程执行的...

I opened both templates and set breakpoints - first one on Application.Run and the second in "FunctionName". Strange thing happend - after Application.Run was executed, second process apeared in Task Manager and the template was closed. I never got to second breakpoint, as it was executed from another process...

这在一些计算机上发生,并且在一些完全相同的代码上工作正常(在一个过程中)。它开始于几天前(最多2周)。在Windows 7和Word 2010 x86上出现问题。

This is happening on some of the computers, and on some exact same code works fine (in one process). It started a few days ago (2 weeks max). Problem occurs on Windows 7 and Word 2010 x86.

推荐答案


一切正常,直到几天前。

Everything was working fine until a few days ago.

我的Autostart文件夹中有一个模板,可以做一些事情,然后加载另一个模板并从中调用一个函数:

I have a template in my Autostart folder, that does some things and then load another template and call a function from it:

AddIns.Add "TemplateName", True
Application.Run "FunctionName"

当这段代码运行时,我得到MessageBox说我不能保存Normal.dotm。事实证明,它是由Winword的第二个进程引起的 - 第二个进程无法保存normal.dotm,因为它是由第一个进程保存的。但第二个过程是如何开始的?b $ b的?调试显示它是由Application.Run启动的!

When this code was run I got MessageBox saying I can't save Normal.dotm. As it turns out, it was caused by second process of Winword - this second process couldn't save normal.dotm because it was held by first process. But how did the second process got started? Debugging showed that it is started by Application.Run!

我打开了两个模板并设置了断点 - 第一个在Application.Run上,第二个在"FunctionName"中。奇怪的事情发生 - 在执行Application.Run之后,第二个进程在任务管理器中进行,并且模板已关闭。我从来没有
到达第二个断点,因为它是从另一个进程执行的...

I opened both templates and set breakpoints - first one on Application.Run and the second in "FunctionName". Strange thing happend - after Application.Run was executed, second process apeared in Task Manager and the template was closed. I never got to second breakpoint, as it was executed from another process...

这在一些计算机上发生,并且在一些完全相同的代码上工作正常(在一个过程中)。它开始于几天前(最多2周)。在Windows 7和Word 2010 x86上出现问题。

This is happening on some of the computers, and on some exact same code works fine (in one process). It started a few days ago (2 weeks max). Problem occurs on Windows 7 and Word 2010 x86.

我将此移至Word for Developers论坛,希望您能得到更好的响应。

I am moving this to Word for Developers forum in the hope you will get better response.

希望这有帮助,


这篇关于Application.Run启动另一个Word进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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