Office加载丝带调试完毕后不会消失 [英] Office add-in ribbon won't go away after debugging

查看:117
本文介绍了Office加载丝带调试完毕后不会消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Visual Studio 2010中我创建了一个Office 2010的Word加载项项目中,有一对夫妇基本控制的丝带。我还没有加code呢。当调试项目字启动和色带(色带1)被示出。所有优秀的,到目前为止,但...

Using Visual Studio 2010 I created an Office 2010 Word add-in project that has a ribbon with a couple of basic controls. I haven't even added code yet. When I debug the project Word launches and that ribbon ("Ribbon 1") is shown. All good so far, but...

问题1:现在,当我打开的任意的Word文档相同的带状仍然存在

Problem 1: Now when I open any Word document that same ribbon is still there!

问题2:我有一个第二带(丝带2)是我工作的另一个项目。当我调试,无论是色带1色带2出现合并为1丝带!这结合丝带还表示,下一次我打开的任意的Word文档。

Problem 2: I have a 2nd ribbon ("Ribbon 2") that I'm working on in another project. When I debug that, BOTH Ribbon 1 and Ribbon 2 appear combined as 1 ribbon! And that combined ribbon still shows the next time I open any Word document.

两个问题的根源似乎是Visual Studio中没有正确卸载色带时,我停止调试。我一直在努力解决它通过手动安装色带自己,然后通过VSTOInstaller.exe卸载它 - 一个真正的痛苦

The source of both problems seems to be that Visual Studio is not properly uninstalling the ribbon when I stop debugging. I've been working around it by manually installing the ribbon myself and then uninstalling it via VSTOInstaller.exe -- a real pain.

如何我可以确保当我停止调试色带完全删除吗?

How can I make sure the ribbon is completely removed when I stop debugging?

(我发现了一个类似的问题这里但无论答案是明确的。)

(I found a similar question here but neither answer is clear.)

推荐答案

在安装了VSTO加载项,将其添加到Windows注册表中 HKEY_CURRENT_USER \软件\微软\办公室\字\加载项的话语。 (加载项的其他Office应用程序都在附近。)

When a VSTO add-in is installed, it is added to the Windows registry under HKEY_CURRENT_USER\Software\Microsoft\Office\Word\Addins for Word. (Add-ins for other Office apps are nearby.)

最简单的事情是写你自己的控制台应用程序,只需删除您的加载项从注册表中的位置。它所需要做的就是删除文件的命名与您的加载项的子键。然后,你可以每当你与你的调试会话完成后运行程序。

The easiest thing would be to write your own console app that simply removes your add-in from that registry location. All it would need to do is delete the sub key that's named the same as your add-in. Then you could run that utility whenever you're finished with your debugging session.

如果你想让它自动发生,那么你需要弄清楚如何挂钩到Visual Studio中的事件,当你停止调试并从注册表中有删除加载项火灾。我从来没有试过这样的,虽然事情。

If you want it to happen automatically, then you'd need to figure out how to hook into Visual Studio for an event that fires when you stop debugging and remove the add-in from the registry there. I've never tried anything like that though.

这篇关于Office加载丝带调试完毕后不会消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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