1

我为 Exchange 2003 找到了此 Web 部件,但在 Exchange 2007 中,即使在用户登录后,Web 部件也会显示 Exchange 2007 owa 登录页面(而不是当前用户收件箱)。

如何在 moss 2007 中显示当前用户的 Exchange 2007 收件箱?任何的想法?

4

1 回答 1

0

解决方案是围绕开箱即用的 OWA webpart 创建一个包装 webpart,并使用当前登录的用户的电子邮件地址访问收件箱。

这是代码

PS (注意这里的appsettings中设置了webaccess的地址!)

using System;
using System.Configuration;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Portal.WebControls;

namespace DCubed.SharePoint.WeParts
{
  /// <summary>
  /// Wrapper around the My Inbox WebPart
  /// </summary>
  public class MyInboxEx : WebPart
  {
    /// <summary>
    /// Called by the ASP.NET page framework to notify server controls that use     composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
    /// </summary>
    protected override void CreateChildControls()
    {
      // Create the instance of My Inbox Web Part 
      var inbox = new OWAInboxPart
      {
        MailboxName = SPContext.Current.Web.CurrentUser.Email,
        OWAServerAddressRoot = ConfigurationManager.AppSettings["MailServer"]
      };
      Controls.Add(inbox);
    }
  }
}
于 2010-01-06T16:40:18.267 回答