Using custom OpenDocuments control to open custom file types in SharePoint
A customer was having a number of PDF files uploaded into their SharePoint sites. They were using Adobe Acrobat to edit and create PDF files. What customer wanted was, to be able to edit the PDF files directly from SharePoint by getting "Edit with Adobe Acrobat" option in the ECB menu.
We edited the DOCICON.xml file located at <drive>\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\XML to add a new entry for PDF in the <ByExtension> section:
<Mapping Key="pdf" Value="pdf.gif" EditText="Adobe Acrobat" OpenControl="SharePoint.OpenDocuments"/>
As customer also wanted some more control over how PDFs are being edited, we decided to go by the custom OpenDocuments control.
A custom OpenDocuments control was implemented using C# in an attempt to replicate the functionality provided by SharePoint.OpenDocuments control. But with time, it was created into a generic control, that try to find out the application associated with the given file extension, on the client machine and try to do a ShellExecute to open the file.
As the custom control is implemented as a COM control, you would need to register the control in the registry of the client machine. There are a couple of sample registry files in the attached zip archive, which can take care of registering and un-registering of the control. The sample registry files assume that the control is in the GAC of the client machine.
On the SharePoint end, you would need to change DOCICON.xml file to tell SharePoint to use your custom control when clicked on your custom extension, by changing the <ByExtension> section entry to:
<Mapping Key="pdf" Value="pdf.gif" EditText="Adobe Acrobat" OpenControl="Malag.OpenDocuments"/>
Notice that we have changed the “OpenControl” attribute of <Mapping> tag to point to our custom control.
The code for Malag.OpenDocuments control is attached. Hope this provides you with pointers to get you started on the path of created custom OpenDocuments control implementation.