Imagine you have a SharePoint custom search webpart, and on your search results, you return word documents, you will obviously want to at times be able to open them in your MS Word client program for editing. So basically, depending on your office client installed on your local machine, there are 2 different approaches that can be made for Office 2003 and Office 2007/10, using the same function " editDocumentWithProgID2 ". For Office 2003: - If your document libraries versioning settings have got "Require Check out" ticked, then you will first want to check out the document using: onclick ="CheckoutviaXmlhttp(‘{SiteURL}’, ‘{DocumentDownloadURL}’)" - Then to open the document, you use: onclick =" return editDocumentWithProgID2(‘ {DocumentDownloadURL} ’, ”, ‘SharePoint.OpenDocuments’, ’1′,’ {SiteURL} ’, ’0′);" href ="#" - and now combining the above 2 actions into one clickable action: onclick ="CheckoutviaXmlhttp(‘ {SiteURL} ’, ‘ {...