Question

I have an application that pulls data from the SharePoint API and displays it on a web page. When the user clicks on the thumbnail, it opens a new page with the document in a WOPIFrame so they can preview it. The action is set to interactivepreview so they can't modify the file. However, if they click the link in the bottom right of the document "Open in New Window" it will open the document in a new window with the action=preview so they can edit it. I want to either prevent the user from opening in a new window, or if they do click this action, open in a new window in interactivepreview mode so they can't edit it. How can I either hide this functionality or modify it so it never opens the document as action=preview?

thanks.

Was it helpful?

Solution 2

After looking around it appears that there is no direct way to disable this feature. It is all dependent on the permissions of the user. Any other solution (pushing CSS to an IFrame) is a hack and not a solution. SharePoint controls the permissions and will act accordingly for the user/credentials that were used to open the document.

OTHER TIPS

To hide the functionality, put your cursor over the element in question on the webpage and right click, inspect element. Look to see if there is an id or class associated with the div or span that contains the words "Open in New Window". Then add or insert some css to set that id or class to display: none !important;

<style> .classname { display: none !important; } </style>

or

<style> #idname { display: none !important; } </style>

You might need to play with a few different classes/ids before you narrow down to the exact one you wish to hide, but this would prevent the user from being able to interact with it.

Make sure that you are not killing other stuff if it is a class.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top