locked
Disable/Hide "Print to PDF","Download a copy","Embded information" options from document preview pane in Office web apps while previewing the Share Point document library documents. RRS feed

  • Question

  • Hi ,

    Is there any way to hide the extra features of document preview in OWA, I know these kinds of setting we can do by editing the hover panel templates but i don't see any option to do it. Please help. Below is the screenshot for the menu option that i want to hide.

    Doc Preview


    Neetu Tanwar Software Developer

    Monday, February 1, 2016 2:02 PM

Answers

  • Hi,

    In the Office Web Apps server:

    “C:\Program Files\Microsoft Office Web Apps\WebPPTViewer”

    There is a file “powerpointframe.aspx” which is responsible for the display of the PowerPoint file.

    You can add a custom JavaScript into it as below:

    It will hide the Menu button as you wish:

    This is the complete script:

    <script type="text/javascript">
    var intv = setInterval(ready, 100);
    function ready()
    {
    	console.log(document.querySelector("a[title='Menu']"));
    	if(null !== document.querySelector("a[title='Menu']"))
    	{
    		document.querySelector("a[title='Menu']").style.display = "none";
    		clearInterval(intv);
    	}	
    }
    </script>

    Please let me know if there still any question about it.

    Best regards,

    Patrick Liang


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    • Marked as answer by NeetuTanwar Tuesday, February 2, 2016 7:20 AM
    Tuesday, February 2, 2016 3:25 AM

All replies

  • Hi,

    In the Office Web Apps server:

    “C:\Program Files\Microsoft Office Web Apps\WebPPTViewer”

    There is a file “powerpointframe.aspx” which is responsible for the display of the PowerPoint file.

    You can add a custom JavaScript into it as below:

    It will hide the Menu button as you wish:

    This is the complete script:

    <script type="text/javascript">
    var intv = setInterval(ready, 100);
    function ready()
    {
    	console.log(document.querySelector("a[title='Menu']"));
    	if(null !== document.querySelector("a[title='Menu']"))
    	{
    		document.querySelector("a[title='Menu']").style.display = "none";
    		clearInterval(intv);
    	}	
    }
    </script>

    Please let me know if there still any question about it.

    Best regards,

    Patrick Liang


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    • Marked as answer by NeetuTanwar Tuesday, February 2, 2016 7:20 AM
    Tuesday, February 2, 2016 3:25 AM
  • Hi Patrick,

    Thanks for reply, It worked for me. I have did the same thing for word viewer as well. Please confirm it won't impact any other functionality as we did it on OWA server level and how do we implement the same thing for excel if we want to hide "Full Screen" option from excel preview.



    Neetu Tanwar Software Developer

    Tuesday, February 2, 2016 7:20 AM
  • Hi,

    The script I provided will only hide some elements from a page, it won’t do harm to your server.

    You can modify the code like this to hide the “Full Screen” option:

    <script type="text/javascript">
    var intv = setInterval(ready, 100);
    function ready()
    {
    	if(null !== document.querySelector("a[title='Open in New Window']"))
    	{
    		document.querySelector("a[title='Open in New Window']").style.display = "none";
    		clearInterval(intv);
    	}	
    }
    </script>
    

    Best regards,

    Patrick Liang


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Tuesday, February 2, 2016 11:36 AM
  • Hi Patrick,

    I already did this setting for both Word and PowerPoint -frame.aspx(s) by setting none to "Full Screen" and "Open in New window" selector respectively. But i didn't find the frame aspx file for Excel preview where i can add this script for hiding "Full Screen" option.

    Thanks in Advance!


    Neetu Tanwar Software Developer

    Tuesday, February 2, 2016 12:02 PM
  • Hello Patrick,

    What about the options (e.g. Print, Share, Print to PDF) when the file is opened in Office Web Apps (see embedded screenshot)? How do I hide those options please?

    Thanks,

    Wednesday, February 15, 2017 6:23 PM
  • Hi Patrick

       Could you please provide a solution on how to achieve the same in SharePoint online  . I would like to hide the same menu i SharePoint Online Search Preview panel for Word documents .

    regards

    Devkrupa

     

    Thursday, May 4, 2017 9:36 AM