I currently have an Outlook Add-in that has a Ribbon Group with buttons(Designer) in it and all that works fine. I have a contextmenuItem that I have added via a Ribbon Designer (XML) that looks something like that:
Context Menu Button:
<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
<contextMenus>
<contextMenu idMso="ContextMenuMailItem">
<button id="MyContextMenuMailItem"
label="Record To History"
onAction="OnMyButtonClick"/>
</contextMenu>
</contextMenus>
</customUI>
Ribbon Tab:
<?xml version="1.0" encoding="UTF-8"?>
<customUI onLoad="Ribbon_Load" xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon>
<tabs>
<tab idMso="TabMail" insertAfterMso="GroupContactFind">
<group id="RollbaseSettingsGroup" label="Rollbase Settings">
<button id="MyButton" onAction="MyButton_Click" label="MyButton" size="large" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
I can get my ribbon to work seperately without specifying the below code but my ContextMenu doesn't show and I can get my ContextMenu to work seperately but my Ribbon Code doesn't show. Could you suggest me as to where am I going wrong so that I can show both the contextmenu and the ribbon together.
Code:
' This will allow the contextmenuItem to appear on an email Item
Protected Overrides Function CreateRibbonExtensibilityObject() As Microsoft.Office.Core.IRibbonExtensibility
Return New ContextMenuRibbon() 'This only does the contextmenu
End Function
Now I would like to Add this contextmenuitem To my current Ribbon Item's code so that I can access both in one go. Any suggestions on how can I achieve this? I have read this and done everything that it says here but the only difference is that my Ribbon is a Ribbon Designer whereas my ContextMenuItem is a Ribbon XML.
You need to combine both XML parts into a single one: