SharePoint document library has widely used to store Microsoft Office document such as MS Word, MS Excel or MS PowerPoint. It provides seamless integration with Microsoft Office client, in which it will launch appropriate client’s application. For example, if the user clicks *.doc file ; SharePoint client technology will detect and try to launch MS Word application. When the user try to edit document, it also try to launch MS Word application in edit mode. If the client doesn’t have Microsoft Office application installed, then SharePoint will offer file download.
How about launching Remote Desktop Client from SharePoint document library? By default, SharePoint does not support client’s integration for *.rdp file. To provide client’s integration for *.rdp file, we must understand how does client integration in SharePoint happen. Then we will use the same principal, so that we will be able to launch remote desktop client from SharePoint.
How does the integration happen?
Thanks to OpenDocument control, an ActiveX control which is pre-distributed during Microsoft Office client installation. This control is defined in OWSSUPP.dll file. The file is installed in the %ProgramFiles%\Microsoft Office\Office14\ directory on the client computer during Microsoft Office setup.
Problem Using Custom OpenDocument to Handle File
We can create custom OpenDocument to handle any type of file. However there are some prerequisites before you can use custom OpenDocument in SharePoint:
- Custom OpenDocument must implement standard OpenDocument public method members. For more information about OpenDocument public method members, please open technical documentation page here : http://msdn.microsoft.com/en-us/library/cc264316.aspx.
- Custom OpenDocument must be distributed and registered in client’s computer environment. You can use *.cab file to package and distribute the control. For more information about ActiveX packaging, please open technical documentation page here : http://msdn.microsoft.com/en-us/library/aa751974(v=vs.85).aspx.
Having those pre-requisites, non-compliant ActiiveX control will not ready for client’s integration. On the other hand, there are lot of ActiveX control that does not necessarily follow the standard OpenDocument, thus creating a compliant ActiveX control for client’s integration become impractical.
Launching Remote Desktop Client from SharePoint
Finally, we have to register the handler in web.config.
<add name=’RdpViewer’ preCondition=’integratedMode’ path=’*.rdp’ verb=’GET,HEAD’ type=’IdeasFree.RdpHttpHandler, RdpHttpHandler, Version=18.104.22.168, Culture=neutral, PublicKeyToken=a653a773e04292b0′ />
To register in web.config, I use SPWebConfigModification from SharePoint API which will be triggered by feature activation event. The feature is web scoped feature, so that you can activate it from Central Administration for specific web application.
Code and WSP Download
Complete working code and solution file can be downloaded from Microsoft website here (RDPViewer SharePoint Solution).