Outlook功能区自定义 [英] Outlook Ribbon Customization

查看:305
本文介绍了Outlook功能区自定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Visual Studio中使用vc ++在Outlook功能区中添加了一个选项卡,但是在Outlook 2010中打开垂直邮件时,我需要隐藏该选项卡. 我已经为同一张照片拍摄了快照 第一张图片显示:我已经添加了自定义标签,并且在打开Outlook时它可以正确加载. 现在达到要求了.. 第二张图片显示:自定义选项卡,当我在Outlook中打开一封特殊邮件时,我必须从那里隐藏,我必须在Outlook中的更多选项"下面添加相同的内容

i have added a tab in outlook ribbon in using vc++ in visual studio.but i need to hide the tab when opening a perticular mail in outlook 2010. i have attched snapshot for the same first image shows : i have added custom tab and it is loading correctly when i open outlook. now come to requirements .. second image shows : custom tab i have to hide from there when i am opening a perticular mail in outlook and i have to add the same below More option in outlook

添加或删除哪些xml使其起作用

what xml to added or removed to make it work

帮助需要进行的工作.

谢谢

推荐答案

您需要在功能区UI中处理选项卡getVisible事件.

You need to handle the tab getVisible event in your Ribbon UI.

<ribbon>
    <tabs>
        <tab id="MyTab" getVisible="MyTab_GetVisible" label="MyTab">
            <group label="MyGroup" id="MyGroup" >
                <button id="MyButton" size="large" label="MyButton" imageMso="HappyFace" onAction="OnMyButtonClick"/>
            </group>
        </tab>
    </tabs>
</ribbon>

要切换选项卡的可见性,您需要根据需要实施MyTab_GetVisible.请参阅 SSDN上的SampleAddin以供参考.

To toggle the tab visibility, you need to implement MyTab_GetVisible depending on your needs. See SampleAddin on MSDN for reference.

// Only show MyTab when inspector is a read note.
public bool MyTab_GetVisible(Office.IRibbonControl control)
{
    if (control.Context is Outlook.Inspector)
    {
        Outlook.Inspector oInsp = control.Context as Outlook.Inspector;
        if (oInsp.CurrentItem is Outlook.MailItem)
        {
            Outlook.MailItem oMail = oInsp.CurrentItem as Outlook.MailItem;
            return oMail.Sent;
        }
        else
            return false;
    }
    else
        return true;
}

这篇关于Outlook功能区自定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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