Command - onAction

This callback will be executed after click on the Ribbon control.

 

Sample XML Ribbon File: 

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
    <commands>
        <command idMso="Cut" onAction="CallbackCut"/>        
        <command idMso="Copy" onAction="CallbackCopy"/>
    </commands>
</customUI>

Functions in a standard module:

Sub CallbackCut(control As IRibbonControl, ByRef CancelDefault)
   MsgBox "MyCallback Cut"
   CancelDefault = True
End Sub
  
Sub CallbackCopy(control As IRibbonControl, ByRef CancelDefault)
   MsgBox "MyCallback Copy"
   CancelDefault = True
End Sub

 



Back