C#+ Outlook 2010:有没有办法以收件箱中的方式以编程方式同步收件箱中收到的会议响应? [英] C#+Outlook 2010: Is there any way to programmatically sync meeting responses received in Inbox as soon as it lands in Inbox?

查看:68
本文介绍了C#+ Outlook 2010:有没有办法以收件箱中的方式以编程方式同步收件箱中收到的会议响应?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我正在制定一项要求,我需要查找所有与会者是否拒绝了原始会议。一旦与会者的回复落入Inbox [其他回复的路上],就需要运行这种逻辑。

I am working on a requirement where I need to find if all attendees declined the original meeting. This logic need to be run as soon as an attendee response lands in Inbox [other responses on the way].

因此,对于每个回复,我的逻辑开始并尝试确定是否所有与会者原始会议使用每个收件人的MeetingResponseStatus属性拒绝了会议。

So for every response my logic kicks in and try to determine if all attendees of original meeting declined the meeting using MeetingResponseStatus attribute of each recipient.

但是我发现这个逻辑一直无法正常工作,有时我观察到即使所有拒绝的回复都落入收件箱,可能跟踪没有正确更新所有响应,所以我的逻辑仍然让我很少参与。

But I observed that this logic does not work properly all the time and sometimes i observed that even though all declined responses landed in Inbox, probably tracking is not updated properly with all responses yet and so my logic still returns me few participants.

这可能是Outlook的预期行为。有谁知道这是否是预期的?
如果是预期的,如何处理这种情况,我想确定所有与会者是否在响应登陆组织者的收件箱文件夹后拒绝开会。

This might be an expected behavior of Outlook. Anybody knows if this is expected? If it is expected, how to handle this situation where i would like to determine if all attendees declined meeting as soon as responses lands in Inbox folder of Organizer.

我是否需要延迟处理几毫秒,让Outlook首先将这些响应同步到跟踪,然后检查

每个收件人的MeetingResponseStatus属性 ?在Inbox响应后,同步这些详细信息可能需要多长时间?

MeetingResponseStatus attribute of each recipient? How much time it might take to sync such details after response lands in Inbox?

以下是检查与会者回复的示例代码:

Here is my sample code to check attendee responses:

outlook.Recipient extRecipientObj = aItem.Recipients.Cast<outlook.Recipient>().FirstOrDefault(o =>(o.Resolve() && o.AddressEntry.Type == "SMTP") && (o.MeetingResponseStatus != outlook.OlResponseStatus.olResponseDeclined) && !o.Address.Equals(x500Address, StringComparison.CurrentCultureIgnoreCase));

此处x500Address是在收件箱中收到拒绝回复并且我们开始处理的与会者地址。

here x500Address is an Address of attendee whose decline response is received in Inbox and we started processing.

如果有任何类型的SMTP参与者没有拒绝会议然后我决定进一步处理。

Above code line returns if there are any SMTP type attendees who have not declined meeting yet and then I decide my further processing.

请告知。

谢谢,

Suresh

sureshh ...

sureshh...

推荐答案

Hel lo Suresh,

Hello Suresh,

>但我观察到这种逻辑不能一直正常工作,有时我观察到即使所有拒绝的响应都落入Inbox,可能跟踪还没有正确更新所有响应,所以我的逻辑仍然让我很少
参与者。

> But I observed that this logic does not work properly all the time and sometimes i observed that even though all declined responses landed in Inbox, probably tracking is not updated properly with all responses yet and so my logic still returns me few participants.

它在何时何地运行?

无论如何,我建议打破一行复杂的代码并在单独的代码行上声明每个属性或方法调用。这允许立即释放底层COM对象。

Anyway, I'd suggest breaking a complex line of code and declaring each property or method call on a separate line of code. That allows to release underlying COM objects instantly.

您是否立即在代码中释放底层COM对象?

Do you release underlying COM objects in the code instantly?

使用  System.Runtime.InteropServices.Marshal.ReleaseComObject  到
发布完成使用后的Outlook对象。 然后将
变量设置为  无任何   在Visual Basic中( null   在C#中发布对象的引用。  阅读
更多关于
的Systema tically Releasing Objects
文章。

Use System.Runtime.InteropServices.Marshal.ReleaseComObject to release an Outlook object when you have finished using it. Then set a variable to Nothing in Visual Basic (null in C#) to release the reference to the object. Read more about that in the Systematically Releasing Objects article.

注意,w 如果你使用定期约会项目,你应该发布任何先前的参考文献,在访问或修改项目之前获取对定期约会项目的新引用,并在完成后立即释放这些引用
并保存更改。此做法适用于定期 
AppointmentItem   对象,
和任何 
例外     RecurrencePattern   对象。 

Note, when you work with recurring appointment items, you should release any prior references, obtain new references to the recurring appointment item before you access or modify the item, and release these references as soon as you are finished and have saved the changes. This practice applies to the recurring AppointmentItem object, and any Exception or RecurrencePattern object. 

即使在您发布引用并尝试获取新引用之后,如果仍存在由另一个加载项或Outlook持有的活动引用,则为上述对象之一,您的新引用仍将指向该对象的过期副本
。因此,请务必在完成定期约会后立即发布参考资料。

您是否尝试过检查NewMailEx事件处理程序中的响应状态?


这篇关于C#+ Outlook 2010:有没有办法以收件箱中的方式以编程方式同步收件箱中收到的会议响应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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