问题描述
这是我的ribbon.xml文件:
<ribbon>
<tabs>
<tab label="My Tab" idMso="TabAddIns" >
<group label="My Group">
<labelControl label="Input : "/>
<editBox id="editBox1" label="here"/>
<button id="go" label="go" onAction="go_click"/>
</group>
</tab>
</tabs>
</ribbon>
现在在go_click
函数的后端部分中,我想检索插入在editBox1
中的值。
我该怎么做?我偷偷摸摸,但没有发现太多。
public void go_click(Office.IRibbonControl control)
{
// Try to retrieve content of `editBox1` here
}
解决方法
您需要为onChange
控件实现editbox
回调-每次修改文本时都会调用它。回调将IRibbonControl
和一个字符串作为参数。