Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xml 使用VS2010在.NET中自定义Outlook 2007功能区;insertBeforeMso动态函数_Xml_Vsto_Ribbon_Outlook Addin_Vb.net 2010 - Fatal编程技术网

Xml 使用VS2010在.NET中自定义Outlook 2007功能区;insertBeforeMso动态函数

Xml 使用VS2010在.NET中自定义Outlook 2007功能区;insertBeforeMso动态函数,xml,vsto,ribbon,outlook-addin,vb.net-2010,Xml,Vsto,Ribbon,Outlook Addin,Vb.net 2010,有人能帮我获取打开的Outlook项目窗口的第一个选项卡idMso值吗?我需要在ribbon xml文件中动态设置它,因为我发现将每个项目窗口添加到xml代码中是多余的。如果有人可以共享现有的解决方案,那就太好了 谢谢解决了它:) 只需在运行时编辑GetCustomUI中的返回字符串,但首先捕获资源管理器项 Public Function GetCustomUI(ByVal ribbonID As String) As String Implements Office.IRibbonExtens

有人能帮我获取打开的Outlook项目窗口的第一个选项卡idMso值吗?我需要在ribbon xml文件中动态设置它,因为我发现将每个项目窗口添加到xml代码中是多余的。如果有人可以共享现有的解决方案,那就太好了

谢谢

解决了它:)

只需在运行时编辑GetCustomUI中的返回字符串,但首先捕获资源管理器项

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
原始XML字符串:

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

约会项目窗口上的新XML字符串:

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

目前仍然两手空空。我正在使用Ribbon XML和VB.net,这使得在运行时编辑Ribbon变得不可能;我在这里发现了这个想法