自定义xlviewer.aspx

时间:2012-09-06 20:57:21

标签: sharepoint-2010 export-to-excel

我正在尝试自定义SharePoint的xlviewer.aspx页面,以删除“在Excel中打开”按钮并可能将其替换为“下载快照”,是否有其他人尝试过这样做并取得了进展?< / p>

1 个答案:

答案 0 :(得分:0)

将以下Javascript添加到xlviewer.aspx允许我删除excel按钮中的打开

</script>
    <script src="http://code.jquery.com/jquery-latest.js"></script>
    <script type="text/javascript">
    $(document).ready(function ()
    {
        setTimeout(HideOpenInExcelRibbonButton, 10); 
    });

    function HideOpenInExcelRibbonButton()
    {
        $('a[id*="openInExcel"]').hide();  

         var doc = document.getElementsByTagName('ie:menuitem'); 

         for (var i = 0; i < doc.length; i++)
         {
          itm = doc[i];
          if (itm.id.match("OpenInExcel")!=null)
           { itm.hidden=true; }
         } 
        setTimeout(HideOpenInExcelRibbonButton, 10);
    }   
    </script>