Reputation: 478
I am trying to use Ribbon XML to create custom ribbon on Outlook 2010 and 2007, I have one XML file for the ribbon, and it works fine for Outlook 2010, the ribbon appear and is working. But it is not working on Outlook 2007. Since Outlook 2007 does not have ribbon, so in the GetCustomUI() function I have checking on the Outlook version using Application.Version, if the version is >= 14 then it will load the XML file, and if it is < 14 then I called a subroutine to create the menubar using commandbarcontrol, but this didn't work. The add in is not loaded during the startup of 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
How do I use the Ribbon XML feature to support both Outlook 2010 and 2007?
Upvotes: 2
Views: 739
Reputation: 478
I found out the problem. The problem is the Office.dll (C:\Program Files (x86)\Microsoft Visual Studio 10.0\Visual Studio Tools for Office\PIA\Office14\Office.dll) has the property "Embed Interop Types" set to False. This file is not available in user PC.
Upvotes: 1