使用VS2010在.NET中进行Outlook 2007功能区自定义; insertBeforeMso动态功能 [英] Outlook 2007 ribbon customization in .NET using VS2010; insertBeforeMso dynamic function

查看:463
本文介绍了使用VS2010在.NET中进行Outlook 2007功能区自定义; insertBeforeMso动态功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

谢谢

推荐答案

解决了:)

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

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

原始XML字符串:

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

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

New XML string on Appointment item window:

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

这篇关于使用VS2010在.NET中进行Outlook 2007功能区自定义; insertBeforeMso动态功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆