开发者

Word add-in toolbar problem

开发者 https://www.devze.com 2023-03-05 20:25 出处:网络
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

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 n开发者_开发知识库ot 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


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)?

0

精彩评论

暂无评论...
验证码 换一张
取 消