3

可以使用 customUI.xml 文件重新利用 Word 2007 中的 Word 内置命令。

例子:

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

然后我必须在 VBA 中定义一个回调函数来代替内置函数:

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

这是我的问题,如果我想在重新调整用途的函数中重用内部功能,我不知道如何访问它。我的示例很简单,可以通过调用轻松重建保存,ThisDocument.save但正如我所说,这只是显示问题的示例。

调用CommandBars.ExecuteMso('Save')将调用我重新调整用途的函数,而不是原来的函数。任何关于如何在重新调整用途后访问内部功能的想法都非常感谢!

4

0 回答 0