1

Could anyone help me get the first tab idMso value of an opened Outlook item window? I need to dynamically set it in a ribbon xml file, since I figured out it would be redundant to add each item window into the xml code. If anyone has an existing solution to share, that would be great.

Thanks

kmanxi
  • 98
  • 1
  • 9
  • still empty handed at the moment. I'm using Ribbon XML and VB.net which makes editing the ribbon at runtime impossible; found the idea here http://stackoverflow.com/questions/5780063/is-there-a-way-to-access-a-ribbon-xml-at-run-time – kmanxi Sep 18 '12 at 22:53

1 Answers1

2

Solved it :)

Just edit the return string from the GetCustomUI on runtime, but trap the explorer item first

Public Function GetCustomUI(ByVal ribbonID As String) As String Implements Office.IRibbonExtensibility.GetCustomUI
    Dim strResText As String = ""
    Dim strGetRes As String = ""

    Select Case ribbonID


        Case "Microsoft.Outlook.Appointment"

            strGetRes = GetResourceText("OutlookAddIn.Ribbon1.xml")
            strResText = strGetRes.Replace("TabNewMailMessage", "TabAppointment") 'default value of it is TabNewMailMessage

        Case Else

            strResText = GetResourceText("OutlookAddIn.Ribbon1.xml")

    End Select
    Return strResText
End Function

Original XML string:

<tab id="customTab" label="myCustomTab" insertBeforeMso="TabNewMailMessage" visible="true">

New XML string on Appointment item window:

<tab id="customTab" label="myCustomTab" insertBeforeMso="TabAppointment" visible="true">
kmanxi
  • 98
  • 1
  • 9