2016-09-08 75 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