Recently we were faced with the requirement from a client that wanted to be able to edit a Microsoft Word document accessible via SharePoint (via a link) but ensure that once the document was closed, the user could no longer edit it. Thanks to the way Microsoft Office maintains the linking of documents between the client and SharePoint when opening a file, it is easy for a user to view the link to a document or List Item attachment when it opens and then, when saving, see the original file location on the server.
Our issue became how do we lock down the file without a lot of manual permissions but still allow a user to click a link and download a copy of a document. What we crafted was a solution that leveraged the native “_layouts/download.aspx” page to effectively break the link between the file in SharePoint and the local copy a user opens on their machine. Within our documents display, we simply dynamically generate hyperlinks using the following format:
Doing so ensures the copy of the file downloaded to the client machine has no URL or link back to the original location, and thus obscures the ability for a user to click & open a document in SharePoint and then easily save it back to SharePoint – because in this case, that’s exactly what we did not want. As an added perk, since the display was built via XSLT (remember, CAPS supports XSLT 2.0), we were also able to conditionally build the link to the documents based on the overall item status.