Tuesday, 7 April 2009

Launching desktop applications from a Web Part

If your looking for an easy way to create a Web Part which allows users to launch applications from a page on a SharePoint site, then it can be done with the Content Editor Web Part, as pictured below:

All you need to do is create some HTML tables and add the following hyperlink code to a cell in your table, copying your images wherever your image source code locates them:

<a href="javascript:LaunchApp('C:\\Program Files\\Microsoft Office\\Office12\\MSPub.exe')"><img alt="Launch Microsoft Publisher" src="images/PublisherIcon.jpg" width="54" height="54"></a>


You will also need to set "Prompt" or "Enable" for the "Initialize and script ActiveX controls not marked as safe for scripting" security option in Internet Explorer for the zone in which the portal is accessed. If this is an intranet, this should be fairly straightforward as your site should already be present in the "Local intranet" security zone, and more often than not controlled by a Group Policy. This is more difficult if your site is accessible as an extranet site because these machines a) may not trust the site and b) are quite often not controlled by a Group Policy. Obviously, this will relax the security for that zone in the browser, so do not modify this option unless you are sure about doing so.

I have uploaded the Web Part and images shown at the top of this article to the following location if you wish to have a look at or use my example - http://cid-3db995be5d5d9d8f.skydrive.live.com/self.aspx/Public/Launch%20Applications.zip.

8 comments: