Interop.Outlook.Explorer使用后冻结 [英] Interop.Outlook.Explorer freeze after use

查看:91
本文介绍了Interop.Outlook.Explorer使用后冻结的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我们正在使用Interop.Outlook assambly来抓取邮件,这些邮件将被丢弃到我们的应用程序中。这适用于Outlook 2003,2007但是在2010年我们遇到了问题。在获取文件后(从Outlook应用程序对象获取资源管理器对象
- >获取选择 - >获取邮件 - >转换为我们自己的邮件对象...),Outlook资源管理器不会刷新。您可以单击邮件,但Outlook不会刷新邮件预览框架。在您使用邮件进行另一次删除之后,我们看到
旧选择的Outlook文件仍在选择中,但您在outlook中看不到这一点(如果您单击其他邮件然后删除它将删除两者,旧的选择填充和新的)!如果切换到antoher
文件夹,你可以恢复生活。


这看起来我们还有一种未发布的句柄或连接。


我尝试以多种方式杀死COM对象,例如,


 'outlook As Microsoft.Office.Interop.Outlook.Application  

'explorer正如Microsoft.Office.Interop.Outlook.Explorer = Nothing



outlook = 没什么

explorer = 没什么



解决方案

通常在将对象设置为Nothing之前调用Marshal.ReleaseComObject()。我很惊讶没有为你生成例外。


如果你没有看到你正在使用的任何代码,就不可能说你是否需要做任何不同的事情或者需要做更多的事情。


您是否检查了新的选择方法o清除选择或在Outlook 2010中修改它?


 


Hello,

we are using the Interop.Outlook assambly to grab mails witch are dropped to our application. This works fine with Outlook 2003, 2007 but with 2010 we have a probleme. After grabing the files (get the explorer ocject from outlook application object -> get selection -> get the mails -> convert to our own mailing object ... ) the outlook explorer does not refresh. You can click on a mail but outlook will not refresh the mail-preview-frame. After you do another drop with a mail, we see that the old selected outlook files are still in the selection, but you don't see this in outlook (also if you click on another mail and then delete it will delete both, the old selected fill and the new)! You can can bring outlook back to life if you switch to antoher folder.

This looks like we have still a kind of handle or connection that is not released.

I tryed to kill the COM objects in multiple ways like,

'outlook As Microsoft.Office.Interop.Outlook.Application

'explorer As Microsoft.Office.Interop.Outlook.Explorer = Nothing



 outlook = Nothing

 explorer = Nothing



解决方案

Normally you would call Marshal.ReleaseComObject() before you set the object to Nothing. I'm surprised that didn't generate an exception for you.

Without seeing whatever code you are using it's impossible to say if you need to do anything different or need to do something more.

Have you checked out the new Selection methods o clear a selection or modify it in Outlook 2010?

 


这篇关于Interop.Outlook.Explorer使用后冻结的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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