我有一个自动化PowerPoint的命令栏模型.我最近遇到了一个奇怪的问题,即通过我的应用程序打开PowerPoint,并通过我的应用程序加载数据以填充菜单.如果用户右键单击PowerPoint,我会收到错误消息:
Call was rejected by callee powerpoint
你看过这个教程吗?:
How to: Fix ‘Application is Busy’ and ‘Call was Rejected By Callee’ Errors
How to: Fix ‘Application is Busy’ and ‘Call was Rejected By Callee’ Errors
To fix errors:
1. Add the following class to your application.
2. Add a COM reference toMicrosoft Development Environment 8.0.@H_403_17@ This adds references to
EnvDTE@H_403_17@ and
EnvDTE80@H_403_17@ to your solution.
3. In the code,create an instance ofEnvDTE80@H_403_17@,as outlined in the following example.
4. CallMessage.Register@H_403_17@ to handle thread errors.
5. Call your automation code as usual.
6. When your automation code is finished,callMessage.Revoke@H_403_17@ to remove the thread error handlers.