开发者

Repurpose builtin Word commands - access original command within repurposed function

It is possible to repurpose a Word builtin command in Word 2007 using the customUI.xml file.

Example:

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

I then have to define a callback function in VBA which is used instead of the builtin function:

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

And here is my problem, if I want to reuse internal functionality in my repurposed Function, I don't know how to access it. My example i开发者_运维百科s trivial and the save could be easily rebuilt by a call to ThisDocument.save but as I said, it is just an example to show the problem.

A call to CommandBars.ExecuteMso('Save') would call my repurposed function and not the original one. Any ideas on how to access the internal functionality after repurposing are very appreciated!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜