我可以将 AddIn 写入已打开另一个 AddIn 的 MS Word 吗?

发布于 2024-07-08 17:21:16 字数 98 浏览 7 评论 0原文

我的自定义插件有问题,因为有时,MS Word 禁用了我的插件,我需要编写另一个插件,启用它来打开/关闭我的第一个插件。 是否可以?

对不起我的英语不好 :(

I Have a problem with my custom Addin to word because sometimes, MS Word was disabled my addin, and I need to write another AddIn, which Was enabled to turn - on/off my first AddIn. Is it possible?

sorry for my English :(

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

遇见了你 2024-07-15 17:21:16

我同意 divo 的观点,您的第一步是添加一些异常处理/日志记录,以防止插件被禁用。 您还可以参考这篇文章

在应用程序级项目中进行调试

但是,我也遇到了插件以某种方式被禁用而没有抛出任何异常的问题。 如果上述方法不起作用,您可以随时使用另一个程序将您的插件的 LoadBehavior 从 2 强制设置为 3,这应该重新启用它。

I agree with divo, your first step would be to add some exception handling/logging in order to prevent the addin from being disabled. You can also refer to this article

Debugging in Application-Level Projects

However, I have also had issues with the addin somehow becoming disabled without throwing any exception. If the above approaches do not work you can always go and have another program forcibly set the LoadBehavior of your addin from 2 to 3, which should re-enable it.

愛放△進行李 2024-07-15 17:21:16

您使用哪种附加技术? 维斯托?
您使用什么版本的 Office?

一般来说,可以做你想做的事。 但是,Office 禁用加载项的原因是加载项引发了未处理的异常。 在这种情况下,Office 会将注册表中的 LoadBehavior 值设置为 2。

也许分析和处理导致异常的根本问题会更好。

What kind of add-in technology are you using? VSTO?
What version of Office are you using?

In general it is possible to do what you want. However, the reason that Office disables add-ins is that the add-in threw an unhandled exception. In that case Office will set the LoadBehavior value in the Registry to 2.

Maybe it would be better to analyze and handle the underlying problem causing the exception.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文