0

I have added a column of type URL to my list. The column stores the URLs to files located in the document library on the same site. So, when I view the properties of my list item I can click on the URL which opens the file from the document library.

The problem that I have is that when I click the URL, I am offered to open or save the file by Internet Explorer. If I choose to open it, it opens (in Word), but it's in read-only mode. I want to achieve the same effect as if I clicked the file name to open it from the document library. Right now, Word is not treating that document as it is coming from SharePoint.

What needs to be changed in order to be able to open the document and to edit it?

1

Here is a blog by Adis Jugo titled OPEN SHAREPOINT FILES IN EDIT MODE FROM CLIENT APPLICATIONS (AND NOT READ ONLY). There he explains how you can make modifications in two ways, with JavaScript and with changing the URL of the file.

Cite:

The first one is, if you are developing custom HTML solution (does not matter if inside or outside of SharePoint), you can use the editDocumentWithProgID JavaScript function from SP.JS. This will show the open document dialog, just as you know it from SharePoint:

<a href=""
onclick="editDocumentWithProgID2('http://server/site/doclib/folder/Document.docx', 
'', 
'SharePoint.OpenDocuments', '0', 
'http://server/site', '0')">
This will open the file in edit mode
</a>

Of course, you will need to include the SP.JS file if you are outside of SharePoint – it is stored in the LAYOUTS folder of 14 hives for SharePoint 2010 (usually: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS)

The second option will be to replace “http://” in the document URL with “file://”. This will open the document directly in edit mode, without any prompting. From my experience, this works well in local intranets, causes troubles in public sites.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.