我正在尝试使用 Ribbon XML 在 Outlook 2010 和 2007 上创建自定义功能区,我有一个用于功能区的 XML 文件,它适用于 Outlook 2010,功能区出现并且正在工作。但它不适用于 Outlook 2007。由于 Outlook 2007 没有功能区,因此在 GetCustomUI() 函数中,我使用 Application.Version 检查 Outlook 版本,如果版本 >= 14,则它将加载 XML 文件,如果它 < 14,那么我调用了一个子程序来使用 commandbarcontrol 创建菜单栏,但这不起作用。在 Outlook 2007 启动期间未加载加载项。
Protected Overrides Function CreateRibbonExtensibilityObject() As Microsoft.Office.Core.IRibbonExtensibility
Return New MyRibbon
End Function
Public Function GetCustomUI(ByVal ribbonID As String) As String Implements Microsoft.Office.Core.IRibbonExtensibility.GetCustomUI
If iOfficeVersion >= 14 Then
Return GetResourceText("MyRibbon.xml")
ElseIf iOfficeVersion < 14 Then
'Load commandbar UI
End If
End Function
如何使用功能区 XML 功能同时支持 Outlook 2010 和 2007?