如何将快捷键分配给添加到Outlook 2016消息功能区的VBA宏 [英] How to assign shortcut key to VBA macro added to Outlook 2016 Message Ribbon
问题描述
是否可以将加速键或快捷键分配给已分配给添加的自定义按钮的VBA宏到消息选项卡上的Outlook 2016功能区?
该按钮成功执行VBA宏,但我还想指定一个快捷键(可能是[Alt] + [M])。
>>该按钮成功执行VBA宏,但我还想指定一个快捷键(可能是[Alt] + [M])。
< p style ="margin:0in; FONT-FAMILY:宋体; font-size:11.0pt">
如何创建自定义功能区?
RibbonButton.KeyTip
Property
在Ribbon Designer中,你可以使用
private void Ribbon1_Load(object sender,RibbonUIEventArgs e)
{
button1.KeyTip =" G";
}
在功能区(XML)中,你可以使用
<?xml version =" 1.0" encoding =" UTF-8"?>
< customUI xmlns =" http://schemas.microsoft.com/office/2009/07/customui" onLoad =" Ribbon_Load">
< p lang ="zh-CN"style ="margin:0in; FONT-FAMILY:宋体; font-size:11.0pt"> < ribbon>
< tabs>
< tab idMso =" TabAddIns">
< group id =" MyGroup"
label =" My Group">
< button id =" test" keytip =" G" label =" test" onAction =" ; test" />
< / group>
< / tab>
< / tabs>
< / ribbon>
< / customUI>
如果您没有使用VSTO项目,请分享有关如何自定义功能区的详细步骤并将宏指定给自定义按钮,以便我们可以尝试重现并查找是否有
任何解决方案和解决方法。
感谢您的理解。
问候,
蔚
Is it possible to assign an accelerator key or shortcut key to a VBA macro that has been assigned to a custom button that is added to the Outlook 2016 Ribbon on the Message tab?
The button successfully executes the VBA macro, but I would like to also assign a shortcut key (perhaps [Alt]+[M]).
Hi,
>>The button successfully executes the VBA macro, but I would like to also assign a shortcut key (perhaps [Alt]+[M]).
How do you create your custom ribbon?
Do you create an VSTO Add-in? In VSTO Add-in projects, we could get or set the keyboard shortcut of the button by using RibbonButton.KeyTip Property
In Ribbon Designer, you could use
private void Ribbon1_Load(object sender, RibbonUIEventArgs e)
{
button1.KeyTip = "G";
}
In Ribbon(XML), you could use
<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
<ribbon>
<tabs>
<tab idMso="TabAddIns">
<group id="MyGroup"
label="My Group">
<button id="test" keytip ="G" label ="test" onAction ="test"/>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
If you are not using VSTO project, please share the detail steps about how you customize the ribbon and assign the macro to a custom button, so that we could try to reproduce and find if there are any solutions and workarounds.
Thanks for your understanding.
Regards,
Celeste
这篇关于如何将快捷键分配给添加到Outlook 2016消息功能区的VBA宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!