Outlook 2007 ribbon customization in .NET using VS2010; insertBeforeMso dynamic function

﹥>﹥吖頭↗ 提交于 2020-01-16 03:57:06

问题


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


回答1:


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">


来源:https://stackoverflow.com/questions/12467937/outlook-2007-ribbon-customization-in-net-using-vs2010-insertbeforemso-dynamic

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!