[英]Getting the Outlook Out of Office flag with .NET
My company is using Exchange 2003. 我的公司正在使用Exchange 2003。
Is it possible to query exchange from .NET code to find out if someone's 'Out of Office' assisstant is on or off? 是否可以从.NET代码查询交换,以查明某人的“外出”助手是否开启或关闭?
Using the Outlook Redemption library, you can get Out of Office status like this: 使用Outlook Redemption库,您可以获得这样的Out of Office状态:
public bool IsOutOfOffice()
{
var outlook = new Microsoft.Office.Interop.Outlook.Application();
var rdoSession = new Redemption.RDOSession();
rdoSession.MAPIOBJECT = outlook.Session.MAPIOBJECT;
Redemption.RDOOutOfOfficeAssistant OOFA =
(_rdoSession.Stores.DefaultStore as Redemption.RDOExchangeMailboxStore).OutOfOfficeAssistant
return OOFA.OutOfOffice;
}
To check another user's status, you need to get the MAPIOBJECT
for their mailbox. 要检查其他用户的状态,您需要为其邮箱获取MAPIOBJECT
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.