Home > Net >  How to call in VSTO build in function after were overwritten?
How to call in VSTO build in function after were overwritten?

Time:01-18

In my Ribbon.xml is given:

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

in my 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

}

I already try

RibbonUi.ActivateTabMso("TabSave");

and

Application.CommandBars.ExecuteMso("FileSave");

How call origial functionality?

CodePudding user response:

Maybe this could work?

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