2012-11-05 36 views
2

我想用功能區XML在Outlook 2010和2007上創建自定義功能區,我有一個用於功能區的XML文件,它對Outlook 2010工作正常,功能區出現並且工作中。但它不適用於Outlook 2007。由於Outlook 2007沒有功能區,因此在GetCustomUI()函數中,我使用Application.Version檢查Outlook版本,如果版本大於等於14,則它將加載XML文件,如果它是< 14,那麼我調用一個子程序來使用commandbarcontrol創建菜單欄,但是這不起作用。在Outlook 2007啓動過程中,加載項未加載。用於Outlook 2007和Outlook 2010的一個Ribbon功能

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?

回答

1

我發現了這個問題。問題是Office.dll(C:\ Program Files(x86)\ Microsoft Visual Studio 10.0 \ Office \ PIA \ Office14 \ Office.dll的Visual Studio工具)的屬性「Embed Interop Types」設置爲False。該文件在用戶PC中不可用。

相關問題