简体   繁体   English

COMAddIns如何在Office Word 2003中以编程方式打开/关闭它们

[英]COMAddIns how to turn them on/off programmatically in Office Word 2003

I need to be able to turn off a COM add-in in Office Word 2003 but still keep it in the COMAddIn list (just not enabled). 我需要能够在Office Word 2003中关闭COM加载项,但仍将其保留在COMAddIn列表中(只是未启用)。

I have found the COMAddIn.Connect flag and I set it to false to try and turn if off but it seems to completely remove it from Office Word and I have to re-install the program to get it back again (seems to turn off the registry keys). 我已经找到COMAddIn.Connect标志,并且将其设置为false以尝试关闭它,但是它似乎已将其从Office Word中完全删除,因此我必须重新安装该程序以再次将其取回(似乎要关闭注册表项)。

So My question is how do you turn off an Office Word 2003 COMAddIn without completely removing it from Word itself? 因此,我的问题是如何关闭Office Word 2003 COMAddIn,而不将其完全从Word本身中删除?

Also note that I'm using c# 另请注意,我正在使用c#

Thanks 谢谢

I figured it out, You want to loop through the list in your CommandBar property and set the visible to false for which ever add-ins you want to be turned off. 我弄清楚了,您想遍历CommandBar属性中的列表,并将visible设置为false,以关闭要关闭的加载项。 you set the visible to true to turn them on. 您将visible设置为true以将其打开。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM