10

How do I hide the EDIT IN WORD command in Word Web App when viewing a PDF? Is it possible to hide it per-site or per-library?

enter image description here

3
  • You can try injecting some script and hide particular element if the Word Web App allows. If it doesn't work, then there is no other way. Most probably this is not possible as per my thinking because it is Office UI that you cannot change. (They don't allow such customizations).
    – Pradip R.
    Commented Dec 23, 2015 at 5:54
  • 1
    Seems the simplest way is to make the library read-only for users. Unfortunately we use a workflow to create the PDF document in the library - and we want it to show-up with the users modification history (rather than a system account).
    – PeterX
    Commented Dec 24, 2015 at 2:06
  • Did you get any solution for this? Commented Jan 18, 2017 at 10:29

1 Answer 1

1

I used the URL contained in the ServerRedirectedEmbedURL, managed property of the document library as the source attribute on an iframe, to load up a view only version of the document in the appropriate Web App (Word, in the case of PDFs).

I implemented this through JavaScript in one of my SharePoint 2013 hosted applications, but with some tweaking you can also use it in custom templates.

Elio Struyf wrote up a nice blog on managed properties, which can be found here https://www.eliostruyf.com/three-useful-managed-properties-for-working-with-office-web-apps/.

He provides some good examples and continues to explain that you'll need to add the the managed properties to the ManagedPropertyMapping attribute inside the display template, in order to use them. Below is a code snippet from Elio showing how to do just that.

<mso:ManagedPropertyMapping msdt:dt="string">'Link URL'{Link URL}:'Path','Line 1'{Line 1}:'Title','Line 2'{Line 2}:'','FileExtension','SecondaryFileExtension','ServerRedirectedEmbedURL','ServerRedirectedPreviewURL','ServerRedirectedURL'</mso:ManagedPropertyMapping>
2
  • Can you post some important things from the blog please, like code snippet, description etc. This will add value to your answer. Sometimes links break hence its good to have content in your answer :).
    – Asad Refai
    Commented Feb 10, 2017 at 9:42
  • 1
    Sure, answer edited. Commented Feb 11, 2017 at 3:30

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