Problem:Clicking a Microsoft Office document (Word, Excel, PowerPoint, etc) in a document library re-challenges for authentication on a secure site.
Reason:By default when you click the document name or icon you are re-challenged for your log-on credentials because the document is passed to Office for handling. Office cannot retrieve the session cookie from IE because it is in a separate process. This is a nuisance for most users because they are not interested in editing the document in the first place and they don't know that it is possible to... Hover the item --> Select the drop down --> Send To --> Download A Copy
This will download the file without the Office/SharePoint hooks for editing. This is not a user friendly way to view a document.
My Desired Goal:Have the link open the document directly.
Fix:
Backup and Open: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033\CORE.JS
Find:
[code:html]C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033\CORE.JS[/code]
Find:
[code:js]
function DispDocItemEx(ele, fTransformServiceOn,
fShouldTransformExtension, fTransformHandleUrl, strProgId)
{
[/code]
Add below:
[code:js]
/*************************************************************
Suppress Document Authentication Prompt Mod for WSS 3.0
by Kevin Cornwell 2/28/2007
Open document without SharePoint hook to edit,
thus suppressing the authentication prompt.
*************************************************************/
var _ele;
if (_ele = ele.toString()){
if (_ele_ext = _ele.substring(_ele.lastIndexOf('.')+1).toLowerCase()){
/* list of office docs */
var arr_office_ext = new Array('doc','xls','dot','dotx','dotm','bmp','gif','jpeg','jpg','csv','docm','docx','docmhtml',
'docxml','dothtml','gcsx','ico','mdb','mde','mdn','png','pot','pothtml','potm','potx','pps', 'ppsx',
'ppt','pptm','pptx','pub','potm','ppam','ppsm','xlb','xlc','xls','xlsx','xlsm','xlt','xltm','xlsb','xlam','xltx','xlw','xlxml');
var _i;
var b_office_doc =
false;
/* check for ext in array */ for (_i=0; _i < arr_office_ext.length; _i++) {
if (arr_office_ext[_i] === _ele_ext){
//alert(_ele);
b_office_doc =
true;
break;
}
}
/* send only if office ext */ if (b_office_doc){
/* Open the doc via download.aspx (supress sp editing) */ STSNavigate(ctx.HttpRoot + '/_layouts/download.aspx?SourceUrl=' + _ele);
/* Kill the “regular” sp handling of the doc (edit mode)
onClick(true) and simply download the doc. */ return false;
}
}
}
/* End mod ***************************************************/
[/code]
Restart your browser and test. To clear the browser cache, click CTRL + F5.
Notes:You will still have the capability to edit/save to the SharePoint site directly: Hover the item --> Select the drop down --> Edit in Microsoft X. Not tested in any other flavor of SharePoint.