Monday, March 7, 2011

Configure My Inbox Webpart in SP2007

MOSS 2007 enables users to access their emails through MY Inbox Webpart. The following are the steps involved to configure the webpart.

1. Add the webpart to your Webpart Page



2. Modify its properties
Enter Mail server address and Mailbox details.
Mail server: http://<mail server address>/exchange
Mailbox: <username>


For dynamic webpart type in ? in mailbox field



The My Inbox webpart display your emails as shown.



There is one more way to show your emails through Content Editor WebPart (CEWP).

1. Add a Content Editor webpart to your webpart page
2. Enter the following code to display outlook emails to your sharepoint page.

<OBJECT classid="CLSID:0006F063-0000-0000-C000-000000000046" width="100%" height="300px">
<param name="Folder" value="Inbox">
</OBJECT>

Problems with this (CEWP) Approach

1. It requires Outlook to be installed in your local machine
2. It authenticates with the Logged in user of the Operating System not with the portal.

Monday, February 8, 2010

To Maintain Scroll Position

<input type="hidden" name="VPos" runat="server" id="VPos" value="0" />
<input type="hidden" name="HPos" runat="server" id="HPos" value="0" />
<script type="text/javascript">
function RestoreScrollPosition() {
var vPos = document.getElementById("VPos");
var hPos = document.getElementById("HPos");
//alert(vPos.value);
scrollTo(hPos.value, vPos.value);
}
function getScrollXY() {
var scrOfX = 0, scrOfY = 0;
if (typeof (window.pageYOffset) == 'number') {
//Netscape compliant
scrOfY = window.pageYOffset;
scrOfX = window.pageXOffset;
} else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) {
//DOM compliant
scrOfY = document.body.scrollTop;
scrOfX = document.body.scrollLeft;
} else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
//IE6 standards compliant mode
scrOfY = document.documentElement.scrollTop;
scrOfX = document.documentElement.scrollLeft;
}
return [scrOfX, scrOfY];
}
function SaveScrollPositions() {
pos = getScrollXY();
var vPos = document.getElementById("VPos");
var hPos = document.getElementById("HPos");
hPos.value = pos[0];
vPos.value = pos[1];
setTimeout('SaveScrollPositions()',10);
}
SaveScrollPositions();
window.onload = RestoreScrollPosition;
</script>

Friday, January 29, 2010

SharePoint Search Scope Drop Down List - Remove "This Site:"

In my Publishing portal, I have created 3 Search Scopes and configured the Search Settings to display the search results in Search Center (/Search/results.aspx).

It worked fine for all three scopes with no issues, but the problem is with the uninvited scope “This Site . This is a contextual scope (Default Scope) which always included to the scope dropdown by default out of our notice. There is no UI Setting/Configs to change this behavior. This Contextual scope always displays the search results to the ooSearchresults.aspx page which I don’t want.

This unwanted scope (“This Site ”) can be removed by injecting the following JavaScript to the master page.

<script type="text/javascript">

function SearchScDDLInj()
{
var srhScDDL = document.getElementById("ctl00$PlaceHolderSearchArea$ctl01$SBScopesDDL");
srhSpDDL.remove(0);
}
SearchScDDLInj();


</script>

Thanks!