【问题标题】:How to call in VSTO build in function after were overwritten?被覆盖后如何在VSTO内置函数中调用?
【发布时间】:2023-01-17 21:43:54
【问题描述】:

在我的 Ribbon.xml 中给出:

<command idMso="FileSave" onAction="SaveIntercept" getEnabled="IsSaveInterceptEnabled" /> 

在我的 Ribbon.cs 中

public void SaveIntercept(IRibbonControl control, ref bool cancelDefault)
{
  if (!IsFileSavedBefore()) <= works :)
  {
    call here build in FileSave 
    (Build in function switch tab when file was never saved before)
    return;
  }
... File was saved before ... continue with my code

}

我已经试过了

RibbonUi.ActivateTabMso("TabSave");

Application.CommandBars.ExecuteMso("FileSave");

如何调用原始功能?

【问题讨论】:

    标签: c# vsto office-addins


    【解决方案1】:

    也许这行得通?

    public void SaveIntercept(IRibbonControl control, ref bool cancelDefault)
    {
      if (!IsFileSavedBefore())
      {
        cancelDefault = false;
        return;
      }
      ...
    

    【讨论】:

      猜你喜欢
      • 2012-08-09
      • 1970-01-01
      • 1970-01-01
      • 2010-10-25
      • 2013-04-08
      • 2020-04-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多