Word加载项工具栏问题
我正在构建一个 word2k3 插件,并且正在创建一个包含相关按钮的新工具栏。一切似乎都工作正常,除了根据谁正在查看活动文档,必须启用/禁用某些按钮。这不是问题,因为我只需将 button.enabled 设置为 true/false 就可以了。
我的问题是,在启用/禁用这些按钮几次后,我突然收到 Hresult 错误。我尝试用谷歌搜索该错误,它显示了有关按钮不存在或其他内容的信息。 确切的异常如下: {"Exception from HRESULT: 0x800A01A8"} System.SystemException {System.Runtime.InteropServices.COMException}
我对这个问题感到非常困惑,因为它是随机发生的,我只是不知道会发生什么造成它。
ps:我的菜单栏上也有按钮,但这个问题从来没有出现过,只出现在工具栏上。
干杯
I am building a word2k3 add-in and i'm creating a new toolbar containing the relevant buttons. All seems to work fine except, depending on who is viewing the active document, certain buttons must be enabled/disabled. This is not a problem as I simply set the button.enabled to true/false and it does the trick.
My problem is that after enabling/disabling these buttons a couple of times, I suddenly get an Hresult error. I tried googling the error and it says something about the button not being there or something.
The exact exception is the following: {"Exception from HRESULT: 0x800A01A8"} System.SystemException {System.Runtime.InteropServices.COMException}
I'm utterly confused about this issue since it occurs at random times and I just cant figure out what might cause it.
p.s.: I also have buttons on the menu bar and this problem never occurs there, only on the toolbar.
cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来不知何故你失去了对按钮的引用。它们在全局变量中吗?这些变量是否会被清除(也许是通过您忘记的事件代码)?
It sounds like somehow you're loosing the reference to the buttons. Are they in global vars? Could those vars be being cleared (maybe by event code you've forgotten about)?