激活特定的功能区选项卡 [英] Activate a particular Ribbon Tab

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

问题描述

我已经看到很多关于如何ActivateTab OnLoad 的代码,但无法让它动态工作......例如,单击工作表按钮.

I've seen lots of code for how to ActivateTab OnLoad but can't get it to work dynamically... on the click of a worksheet button for example.

Sheet1 上有一个按钮指向 startHereConfigure

There is a button on Sheet1 pointing at startHereConfigure

<customUI onLoad="RibbonOnLoad"
    xmlns="http://schemas.microsoft.com/office/2009/07/customui">

Public Rib As IRibbonUI
Sub RibbonOnLoad(ribbon As IRibbonUI)

    Set Rib = ribbon

End Sub

Sub startHereConfigure()

    Rib.ActivateTab "Configure"

End Sub

我希望能够调用 startHereConfigure(和其他类似的子程序)来突出特定选项卡 - 我该怎么做?

I want to be able to call startHereConfigure (and other similar subs) to bring to the fore a particular Tab - how do I do this?

推荐答案

将此行添加到自定义 XML 文件中:

Add this line to the custom XML file:

<customUI onLoad="RibbonOnLoad" xmlns="http://schemas.microsoft.com/office/2009/07/customui">

其中RibbonOnLoad"是启动 Outlook 时要调用的函数的名称.

Where "RibbonOnLoad" is the name of the function to be called upon starting Outlook.

将此功能添加到标准模块中:

Add this funciotn into a standard module:

Public Rib As IRibbonUI

Sub RibbonOnLoad(ribbon As IRibbonUI)
   Set Rib = ribbon    
   Rib.ActivateTab "Configure" ' Name of the tab to activate    
End Sub

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

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