Word自定义图库的isEnabled回调 [英] isEnabled callback for Word Custom Gallery

查看:108
本文介绍了Word自定义图库的isEnabled回调的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在使用VSTO for Office 2007进行开发。在我的自定义Word功能区中,我显示了一些自定义图库内容并拦截了ActiveDocument_BuildingBlockInsert事件在activedocument中插入构建块的内容。我的问题是
的常规文档,其中自定义构建块不可用我想拦截isEnabled回调来控制自定义库的启用/禁用。我怎样才能做到这一点?我知道它可以在常规按钮上改变用途,但是b $ b不确定画廊。请建议。


< 图库
idMso
=
" CustomCoverPageGallery "
标签 = " 封面
页面
"
size = " " />


这个
是我们在带状xml中使用它的方式。


 

 


Sayan Chaudhuri

解决方案

您好,


除了按钮,切换按钮和复选框之外,您无法重新调整内置控件的用途请参阅

临时重新调整命令Office Fluent Ribbon
。即使在这种情况下,您也无法拦截Enabled 事件。我建议您使用我们的免费内置控件扫描仪(下载它

这里
)找到一个启用/禁用的命令栏控件然后,您可以使用Office.CommandBars界面的OnUpdate事件来检查该控件是启用还是禁用。


您怎么看?


Hi,

I am developing in VSTO for Office 2007. In my custom Word Ribbon, I am displaying some custom gallery content and intercepting the ActiveDocument_BuildingBlockInsert event to insert the content of the building block in the activedocument. My question is in case of a regular document where the custom building block is not available I want to intercept the isEnabled callback to control the enabling/disabling of the custom gallery. How can I do that? I know it can be repurposed someway for the regular buttons, not sure about galleries though. Please suggest.

<gallery idMso ="CustomCoverPageGallery" label="Cover Page" size="large"/>

This is how we are having it in our ribbon xml.

 

 


Sayan Chaudhuri

解决方案

Hello,

You cannot repurpose a built-in control other than a button, toggle button, and check boxe see Temporarily Repurpose Commands on the Office Fluent Ribbon. And even in this case, you cannot intercept the Enabled event. I'd suggest that you use our free Built-in Controls Scanner (download it here) to find a commandbar control which is enabled/disabled together with the built-in gallery. Then you can use the OnUpdate event of the Office.CommandBars interface to check whether that control is enabled or disabled.

What do you think?


这篇关于Word自定义图库的isEnabled回调的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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