【问题标题】:how to show current user's inbox in sharepoint 2007如何在 sharepoint 2007 中显示当前用户的收件箱
【发布时间】:2011-01-02 00:32:37
【问题描述】:
我找到了 Exchange 2003 的 this web part,但在 Exchange 2007 中,即使在用户登录后,Web 部件也会显示 Exchange 2007 owa 登录页面(而不是当前用户收件箱)。
如何在 moss 2007 中显示当前用户的 Exchange 2007 收件箱?有什么想法吗?
【问题讨论】:
标签:
sharepoint-2007
web-parts
exchange-server-2007
outlook-web-app
【解决方案1】:
解决方案是围绕开箱即用的 OWA webpart 创建一个包装 webpart,并使用当前登录用户的电子邮件地址访问收件箱。
这是代码
P.S. (注意这里的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);
}
}
}