You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何从Outlook功能区下拉控件获取索引值及测试参数问题

自定义Outlook功能区下拉控件获取索引值问题

我正在尝试从Outlook功能区的自定义下拉控件中获取选中项的索引值,该下拉控件内添加了多个选项和按钮。其中按钮的onAction属性可正常触发宏,示例代码如下:

Sub SOLV_Commercial()
        SOLV_emailGenerator ("SAP DS.sap-ds-commercial")
End Sub

但下拉控件自身的onAction属性无法向DDOnAction子程序传递参数,代码如下:

Sub DDOnAction(control As IRibbonControl, ID As String, index As Integer)
    MsgBox index
End Sub

我已在Excel中实现了预期功能,但Outlook的实现逻辑完全不同。根据建议,我在Outlook的Project1中添加了对应代码,并为下拉控件配置了getSelectedItemIndex属性,Ribbon XML代码如下:

<mso:dropDown id="MydropDown" 
label="SOLV Tickets" 
enabled="true" 
getItemCount="Project1.DDItemCount" 
getItemLabel="Project1.DDListItem"
getSelectedItemIndex="Project1.DDSelctItemIndx"
onAction="Project1.DDOnAction">
    <mso:item id="item" label="Commercial"/>
    ......
    <mso:button id="button1" label="Commercial Interfaces" onAction="Project1.EMAIL_SOLV_Tickets.SOLV_CommercialInterfaces" visible="true" />
    ......
</mso:dropDown >

对应的VBA代码:

Sub DDSelctItemIndx(control As IRibbonControl, ByRef index)
    MsgBox index
End Sub

Sub test()
    DDSelctItemIndx ????,???
End Sub

目前我卡在测试test子程序的环节,不知道该为control和index参数传入什么值。

内容的提问来源于stack exchange,提问作者Lindy

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.23 07:42:58