Thursday, November 02, 2006

Launching Office applications from Sharepoint

My apologies for not posting this last month, I'm pretty busy with a new customer. But I found some time to share my experiences again ;)

As the title suggests, my last challenge was to launch Office applications from Sharepoint. This new customer wanted to use Sharepoint not only as a portal to find information but also to launch it's applications. I knew that Sharepoint was capable to launch the default Office applications like Word, Excel and Powerpoint. But the question was, how to launch Outlook? I tried everything from dirty javascript code to creating a custom webpart which launches the outlook process, nothing worked. Fortunatly Daniel McPherson was in my msn list and he knew the answer. He said 'try using the outlook:// protocol', i was flabbergasted because it worked immediatly ;) Copy and paste this code into a CEWP webpart and voila, you can launch Office apps from Sharepoint

 
<a href="javascript:OpenWord()">Word</a>
<a href="javascript:OpenExcel()">Excel</a>
<a href="javascript:OpenPowerPoint()">Powerpoint</a>
<a href="outlook://inbox">Outlook</a>

<script>

function OpenWord()
{

    var strTemplate = "Word.Document.8";
    var strSaveLocation = "http://intranet";
    var strProgID = "SharePoint.OpenDocuments";
    createNewDocumentWithProgID(strTemplate, makeAbsUrl(strSaveLocation), strProgID, false);

}

function OpenExcel()
{

    var strTemplate = "Excel.Sheet.8";
    var strSaveLocation = "http://intranet";
    var strProgID = "SharePoint.OpenDocuments";
    createNewDocumentWithProgID(strTemplate, makeAbsUrl(strSaveLocation), strProgID, false);

}


function OpenPowerPoint()
{

    var strTemplate = "PowerPoint.Show.8";
    var strSaveLocation = "http://intranet";
    var strProgID = "SharePoint.OpenDocuments";
    createNewDocumentWithProgID(strTemplate, makeAbsUrl(strSaveLocation), strProgID, false);

}

</script>

3 comments:

Anonymous said...

Hi,

The outlook bit does not work for me - I have Outlook 2007 and it just does nothing

Any ideas?

Anonymous said...

Hi,

My outlook, Notepad and calculator is not openning. It displays an error when click on the left hand bottom Error on page "Permission denied"

Anonymous said...

can I launch an Adobe Captivate module from a Sharepoint? If so, How?