被呼叫方 PowerPoint 自动化拒绝呼叫 [英] Call was rejected by callee PowerPoint Automation
问题描述
我有一个自动化 PowerPoint 的命令栏模型.我最近遇到了一个奇怪的问题,即当通过我的应用程序打开 PowerPoint 时,正在通过我的应用程序加载数据以填充菜单.如果用户右键单击 PowerPoint,我会收到错误消息:
I have a commandbar model which automates PowerPoint. I recently faced a strange problem that when PowerPoint is opened through my application, and the data is being loaded through my application to populate the menu. If a user right clicks on PowerPoint I get the error message:
呼叫被被呼叫方 powerpoint 拒绝
Call was rejected by callee powerpoint
我该如何解决这个问题?我正在使用 Office 2003/2007 和 VB.NET 进行办公自动化.
How do I resolve this? I'm using Office 2003/2007 and VB.NET for office automation.
推荐答案
你看过这个教程了吗?:如何:修复应用程序忙"和被调用者拒绝呼叫"错误
Did you see this tutorial?: How to: Fix 'Application is Busy' and 'Call was Rejected By Callee' Errors
修复错误:
1. 将以下类添加到您的应用程序中.
2. 添加对 Microsoft Development Environment 8.0.
的 COM 引用.这会将对 EnvDTE
和 EnvDTE80
的引用添加到您的解决方案中.
3. 在代码中,创建一个 EnvDTE80
的实例,如下例所示.
4.调用Message.Register
处理线程错误.
5. 像往常一样调用您的自动化代码.
6. 当您的自动化代码完成后,调用 Message.Revoke
以删除线程错误处理程序.
To fix errors:
1. Add the following class to your application.
2. Add a COM reference toMicrosoft Development Environment 8.0.
This adds references toEnvDTE
andEnvDTE80
to your solution.
3. In the code, create an instance ofEnvDTE80
, as outlined in the following example.
4. CallMessage.Register
to handle thread errors.
5. Call your automation code as usual.
6. When your automation code is finished, callMessage.Revoke
to remove the thread error handlers.
这篇关于被呼叫方 PowerPoint 自动化拒绝呼叫的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!