Rebuild Word Built-in Commands - Access the original command as part of a reprogrammable function

In Word 2007, you can reprogram the built-in Word command using the customUI.xml file.

Example:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
    <commands>
       <command idMso="Save" onAction="MySave"/>
    </commands>
</customUI>

      

Then I need to define a callback function in VBA that is used instead of the built-in function:

Sub MySave(control As IRibbonControl, ByRef cancelDefault)
     someFancyPreparationFunction
     oldSaveFunction 
     someOtherFancyAfterWorkFunction
End Sub

      

And here's my problem, if I want to reuse internal functionality in my reprogrammed function, I don't know how to get it. My example is trivial and the persistence can be easily rebuilt by calling ThisDocument.save

, but as I said, this is just an example to show the problem.

The call CommandBars.ExecuteMso('Save')

will call my redesigned function, not the original one. Any ideas on how to access the internal functionality after reprocessing are greatly appreciated!

+2


a source to share





All Articles