Exchange 2003 Inbox and Calendar webparts for MOSS 2007
Hi, I've created one Inbox and one Calendar wepbart as descibed here: http://blogs.msdn.com/b/mahuja/archive/2008/07/01/showing-exchange-inbox-in-moss-2007.aspx using OWAInboxPart and OWACalendarPart (code below). When deploying them and placing them on the same page, only one of them will show anything. It looks like the last added webpart works, while the other won't. If any one of them is placed alone on a page, they work as expected. Does anyone know how to make them work togheter on the same page? Thank you for your time! Best regards, Hans Erik Storeide Inbox wp: using System; using System.Runtime.InteropServices; using System.Web.UI; using System.Web.UI.WebControls.WebParts; using System.Xml.Serialization; using Microsoft.SharePoint; using Microsoft.SharePoint.WebControls; using Microsoft.SharePoint.Portal.WebControls; using Microsoft.SharePoint.WebPartPages; namespace Inbox { [Guid("e306c986-b327-41d2-b677-c05ece3c58d3")] public class fmno_Inbox : System.Web.UI.WebControls.WebParts.WebPart { public fmno_Inbox() { this.ExportMode = WebPartExportMode.All; } protected override void CreateChildControls() { base.CreateChildControls(); OWAInboxPart inbox = new OWAInboxPart(); inbox.OWAServerAddressRoot = "http://owa/owa"; string userName = Page.Request.ServerVariables["LOGON_USER"]; string mailboxName = userName; int pos = userName.IndexOf("\\"); if (pos > -1) { mailboxName = userName.Substring(pos + 1); } inbox.MailboxName = mailboxName; inbox.ViewName = "Two Line"; Controls.Add(inbox); } protected override void Render(HtmlTextWriter writer) { // TODO: add custom rendering code here. // writer.Write("Output HTML"); RenderChildren(writer); } } } Calendar wp (just the CreateChildControls bits): protected override void CreateChildControls() { base.CreateChildControls(); OWACalendarPart calendar = new OWACalendarPart(); calendar.OWAServerAddressRoot = "http://owa/owa"; string userName = Page.Request.ServerVariables["LOGON_USER"]; string mailboxName = userName; int pos = userName.IndexOf("\\"); if (pos > -1) { mailboxName = userName.Substring(pos + 1); } calendar.ViewName = "Daily"; calendar.MailboxName = mailboxName; Controls.Add(calendar); }
July 29th, 2010 1:24am

It may have something to do with Exchange 2003. Almost always, you can expect any version of SharePoint to only play nice with it's corresponding version of Office/Exchange. So for SP2007 that would be Ex2007 as well. Nonetheless, I think you can work around it. Try creating a blank page with just one of the web parts on it. Then on the other page where you want both to show up, insert a Content Editor Web Part. Next edit the CEWP to embed an IFrame containing the page created in step 1. This way, the content is actually sources on two different pages, but displayed on a single page. I trust that answers your question... Thanks C http://www.cjvandyk.com/blog
Free Windows Admin Tool Kit Click here and download it now
August 5th, 2010 2:51pm

Hi Hansebs1, Reviewing your code I see you override method Render which is not meant to be overridden. You should override the RenderWebPart Method instead. But this is not the problem. Both SharePoint webparts share the same base class. I have a feeling you are receiving the same ID somewhere. Verify your rendered HTML page to see if are duplicate IDs. Post the HTML part of the controls here (only the webparts). This is my suggestion (not tested): create the classes inheriting from OWAInboxPart and OWACalendarPart (they are not sealed). In the constructor of the classes make base.OWAServerAddressRoot = <your root> and make sure all the other properties of the base are as you wish. You don't need to override anything, base controls will take care for you. It is also recommended that you learn how to debug a web part in SharePoint. This way you can see what is failing. This is a walkthrough of the process: http://blogs.msdn.com/b/echarran/archive/2007/04/28/how-to-debug-a-web-part-for-sharepoint-2007.aspxReagrds, Hiran Microsoft Online Community Support
August 6th, 2010 5:41pm

Hi all! Thank you for replying! I've tried inheriting the classes and only setting the OWAServerRoot, but the result is the same. Here's the HTML for the webparts when on the same page. And just for laughs the calendar webpart shows the inbox and the inbox webpart is empty: Calendar wp (showing inbox): <TD id=MSOZoneCell_WebPartctl00_m_g_2a4e680b_8adb_4a9f_9a62_0015566be3a8 vAlign=top> <TABLE border=0 cellSpacing=0 cellPadding=0 width="100%" TOPLEVEL> <TBODY><TR><TD> <TABLE border=0 cellSpacing=0 cellPadding=0 width="100%"> <TBODY> <TR class=ms-WPHeader> <TD style="WIDTH: 100%" id=WebPartTitlectl00_m_g_2a4e680b_8adb_4a9f_9a62_0015566be3a8 title=fmno_calendar> <H3 class="ms-standardheader ms-WPTitle"><NOBR><SPAN>fmno_calendar</SPAN><SPAN id=WebPartCaptionctl00_m_g_2a4e680b_8adb_4a9f_9a62_0015566be3a8></SPAN></NOBR></H3></TD> <TD style="PADDING-RIGHT: 2px" align=right> <DIV style="CURSOR: pointer" class=ms-HoverCellInActive onmouseover="this.className='ms-HoverCellActiveDark'" onmouseout="this.className='ms-HoverCellInActive'"><NOBR><A onkeydown="MSOMenu_KeyboardClick(WebPartctl00_m_g_2a4e680b_8adb_4a9f_9a62_0015566be3a8_MenuLink, 13, 40)" id=WebPartctl00_m_g_2a4e680b_8adb_4a9f_9a62_0015566be3a8_MenuLink onclick="MSOWebPartPage_OpenMenu(MSOMenu_WebPartMenu, this, WebPartctl00_m_g_2a4e680b_8adb_4a9f_9a62_0015566be3a8,'False');return false;" href="#"><IMG style="PADDING-LEFT: 2px" title="fmno_calendar Web Part Menu" border=0 alt="fmno_calendar Web Part Menu" align=absMiddle src="/_layouts/images/Menu1.gif"></A></NOBR></DIV> </TD></TR></TBODY></TABLE></TD></TR> <TR> <TD vAlign=top> <DIV id=WebPartctl00_m_g_2a4e680b_8adb_4a9f_9a62_0015566be3a8 class=ms-WPBody allowDelete="false" width="100%" HasPers="false" WebPartID="2a4e680b-8adb-4a9f-9a62-0015566be3a8"> <TABLE border=0 cellSpacing=0 cellPadding=0 width="100%" TOPLEVEL> <TBODY> <TR> <TD> <TABLE border=0 cellSpacing=0 cellPadding=0 width="100%"> <TBODY> <TR class=ms-WPHeader> <TD style="WIDTH: 100%" id=WebPartTitleWPQ7 title=""> <H3 class="ms-standardheader ms-WPTitle"><A accessKey=W tabIndex=0 href="http://owa/owa/user1@mylab.com/"><NOBR><SPAN></SPAN><SPAN id=WebPartCaptionWPQ7></SPAN></NOBR></A></H3> </TD></TR></TBODY></TABLE></TD></TR> <TR> <TD class=ms-WPBorder vAlign=top> <DIV id=WebPartWPQ7 class=ms-WPBody allowDelete="false" OnlyForMePart="true" width="100%" HasPers="true" WebPartID="00000000-0000-0000-0000-000000000000"> <DIV id=_div><IFRAME style="WIDTH: 100%; HEIGHT: 250px" src="http://owa/owa/user1@mylab.com/?cmd=contents&amp;part=1&amp;module=inbox&amp;view=Two%20Line" frameBorder=0>IFrames are not supported by your browser.</IFRAME></DIV> <SCRIPT> setTimeout('delayLoad_()', 100); function delayLoad_() { var f=document.getElementById('_div'); f.innerHTML='\u003ciframe frameborder=\u00220\u0022 style=\u0022width:100\u0025;height:250px;\u0022 src=\u0022http:\u002f\u002fowa\u002fowa\u002fuser1@mylab.com\u002f?cmd=contents\u0026amp;part=1\u0026amp;module=calendar\u0026amp;view=Daily\u0022\u003eIFrames are not supported by your browser.\u003c\u002fiframe\u003e'; } </SCRIPT> </DIV></TD></TR></TBODY></TABLE></DIV></TD></TR></TBODY></TABLE> <DIV class=ms-PartSpacingVertical></DIV></TD> Inbox webpart (empty): <TABLE border=0 cellSpacing=0 cellPadding=0 width="100%" TOPLEVEL><TBODY> <TR> <TD> <TABLE border=0 cellSpacing=0 cellPadding=0 width="100%"> <TBODY> <TR class=ms-WPHeader> <TD style="WIDTH: 100%" id=WebPartTitlectl00_m_g_ad1089c7_5c4e_4355_8d65_5e8410aea8a9 title=fmno_inbox> <H3 class="ms-standardheader ms-WPTitle"><NOBR><SPAN>fmno_inbox</SPAN><SPAN id=WebPartCaptionctl00_m_g_ad1089c7_5c4e_4355_8d65_5e8410aea8a9></SPAN></NOBR></H3></TD> <TD style="PADDING-RIGHT: 2px" align=right> <DIV style="CURSOR: pointer" class=ms-HoverCellInActive onmouseover="this.className='ms-HoverCellActiveDark'" onmouseout="this.className='ms-HoverCellInActive'"><NOBR><A onkeydown="MSOMenu_KeyboardClick(WebPartctl00_m_g_ad1089c7_5c4e_4355_8d65_5e8410aea8a9_MenuLink, 13, 40)" id=WebPartctl00_m_g_ad1089c7_5c4e_4355_8d65_5e8410aea8a9_MenuLink onclick="MSOWebPartPage_OpenMenu(MSOMenu_WebPartMenu, this, WebPartctl00_m_g_ad1089c7_5c4e_4355_8d65_5e8410aea8a9,'False');return false;" href="#"><IMG style="PADDING-LEFT: 2px" title="fmno_inbox Web Part Menu" border=0 alt="fmno_inbox Web Part Menu" align=absMiddle src="/_layouts/images/Menu1.gif"></A></NOBR></DIV> </TD></TR></TBODY></TABLE></TD></TR> <TR> <TD vAlign=top> <DIV id=WebPartctl00_m_g_ad1089c7_5c4e_4355_8d65_5e8410aea8a9 class=ms-WPBody allowDelete="false" width="100%" HasPers="false" WebPartID="ad1089c7-5c4e-4355-8d65-5e8410aea8a9"> <TABLE border=0 cellSpacing=0 cellPadding=0 width="100%" TOPLEVEL> <TBODY> <TR> <TD> <TABLE border=0 cellSpacing=0 cellPadding=0 width="100%"> <TBODY> <TR class=ms-WPHeader> <TD style="WIDTH: 100%" id=WebPartTitleWPQ6 title=""> <H3 class="ms-standardheader ms-WPTitle"><A accessKey=W tabIndex=0 href="http://owa/owa/user1@mylab.com/"><NOBR><SPAN></SPAN><SPAN id=WebPartCaptionWPQ6></SPAN></NOBR></A></H3></TD></TR></TBODY></TABLE></TD></TR> <TR> <TD class=ms-WPBorder vAlign=top> <DIV id=WebPartWPQ6 class=ms-WPBody allowDelete="false" OnlyForMePart="true" width="100%" HasPers="true" WebPartID="00000000-0000-0000-0000-000000000000"> <DIV id=_div></DIV> <SCRIPT> setTimeout('delayLoad_()', 100); function delayLoad_() { var f=document.getElementById('_div'); f.innerHTML='\u003ciframe frameborder=\u00220\u0022 style=\u0022width:100\u0025;height:250px;\u0022 src=\u0022http:\u002f\u002fowa\u002fowa\u002fuser1@mylab.com\u002f?cmd=contents\u0026amp;part=1\u0026amp;module=inbox\u0026amp;view=Two\u002520Line\u0022\u003eIFrames are not supported by your browser.\u003c\u002fiframe\u003e'; } </SCRIPT> </DIV></TD></TR></TBODY></TABLE></DIV></TD></TR></TBODY></TABLE> Best regards, Hans E
Free Windows Admin Tool Kit Click here and download it now
September 23rd, 2010 11:17am

Anyone? The customer is not upgrading from Exchange 2003 any time soon... :( Best regards, Hansebs
November 24th, 2010 5:45am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics