Sharepoint - Office Online Server - hide buttons

It's not supported OOTB in Office web apps server.

So you can try the below method. Please note that this method is absolutely not recommended and would most likely be overwritten in a future SharePoint CU update.

Here you go:

For hiding the Share and Embed button in Word,Excel and Powerpoint file, you need to modify the WordViewer.css , excelframe.css , stylesread.css files respectively.

In the 2010, environment, we found the wordviewer.css file at below path and can be edited:

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\INC\1033\WordViewer\WordViewer.css

So, this path might change in the 2016 environment. Just press F12 and check the file path of the above files. Edit the css file, add below css. The selectors(id of the elements) could be different in your environment.

Please take a backup of the files before editing.

//hiding share button in word
#btnFileSharing-Medium20{display:none}; 

//hiding share button in excel
#m_excelWebRenderer_ewaCtl_flyoutExcelShare-Medium20{display:none};

//hiding share button in powerpoint
#PptJewel.Share.ShareWithPeople-Medium20{display:none};

You can find the selector of embed button by inspecting the element and adding display none to it as well.

Once you change the css , save it do an IISRESET. Check the file in browser now.

Tags: