【发布时间】:2014-04-16 21:31:23
【问题描述】:
我们有一个backstage extension 和integrates with the TabSave idMso(文件-->另存为)。
我们遇到的问题是,当我从后台单击按钮时 - 我不知道如何关闭后台视图。
我想出的最佳解决方案不是很健壮,所以我希望有人能有更好的方法来处理这个问题,因为关闭后台视图似乎相当直观。也许我错过了一些东西 - 但是一旦我的按钮触发,我就无法退出后台视图。
功能区 XML
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<backstage>
<tab idMso="TabSave">
<firstColumn>
<taskFormGroup idMso="SaveGroup">
<category idMso="Save">
<task id="customTask" label="Custom Task" imageMso="HappyFace">
<group id="customGroup1" label="Custom Group">
<topItems>
<labelControl id="lblInfo" label="Click to trigger custom action."/>
<button id="btnCustomAction" style="large" label="Custom Action" imageMso="HappyFace" onAction="btnAction"/>
</topItems>
</group>
</task>
</category>
</taskFormGroup>
</firstColumn>
</tab>
</backstage>
</customUI>
功能区回调
public void btnAction(Office.IRibbonControl control)
{
Excel.Window window = control.Context;
MessageBox.Show("custom action triggered");
window.Application.SendKeys("{ESCAPE}");
}
【问题讨论】:
标签: c# excel vsto office-2013