2016-09-08 79 views
1

我沒能去除表篩選按鈕
enter image description here
我使用下面的代碼辦公室2013的JavaScript API - 刪除表過濾器按鈕

Office.context.document.setSelectedDataAsync(sampleDataForExcel, { tableOptions: { filterButton: false } }, 
      function (asyncResult) { 
       if (asyncResult.status === Office.AsyncResultStatus.Failed) { 
        app.showNotification('Could not insert sample data', 
         'Please choose a different selection range.'); 
       } else { 
        Office.context.document.bindings.addFromSelectionAsync(
         Office.BindingType.Table, { id: "myBinding" }, 
         function (asyncResult) { 
          if (asyncResult.status === Office.AsyncResultStatus.Failed) { 
           app.showNotification('Error binding data'); 
          } else { 
           window.location.href = '../index.html'; 
          } 
         } 
        ); 
       } 
      } 
     ); 

回答

0

我剛試過,但它是工作罰款在我的機器上使用以下示例:

Office.context.document.setSelectedDataAsync(myTable, 
    { 
     coercionType: Office.CoercionType.Table, 
     tableOptions: { filterButton: false } 
    } 
+0

試過這個,但不適合我。 – ozil