如何编辑Normal.dotm文件,并使用VB .Net仅删除Addins创建的按钮(程序定义) [英] How to edit Normal.dotm file, and remove only Addins created button(Program Defined) using VB .Net

查看:229
本文介绍了如何编辑Normal.dotm文件,并使用VB .Net仅删除Addins创建的按钮(程序定义)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


类型:关键问题


 


环境


OS  :
- Windows xp sp2 / 7


IDE  :
- Visual Studio 2008


Word:MS Office 2007,MS Office 2010


语言  :
- VB .net


项目   type  :
- 文件
  - >  
项目 
- >其他项目类型 - > 可扩展性
- > 
共享加载项

Project type : - File --> New Project --> Others Project Types -->Extensibility --> Shared Add-in


 


问题描述
我们有正确运行的Addins组件。当我们安装这个组件它创建一个按钮{ SaveDocument }。


但是当我们卸载Addins组件时,它不会删除" SaveDocument"  按钮。



尝试
-
 根据调查结果,我们发现按钮
信息存储在
AppData\Roaming\Microsoft \ Templates \ Normal.dotm。
因此,如果有一些方法,我们可以从Normal.dotm中删除按钮信息,然后可以轻松删除它,而不删除Normal.dotm中的其他设置

Atempt: - According to findings, We found that button information store in AppData\Roaming\Microsoft\Templates\Normal.dotm. So, if some how, we can remove button information from Normal.dotm, then It can be removed easily, without deleting other setting in Normal.dotm



要求
-

Requirement: -


我试图在互联网上搜索编辑,并使用vb.net从Normal.dotm中删除该按钮
信息。但是,到目前为止,我还没有找到任何有用的文章。

I tried to search on internet for editing and remove that button information from Normal.dotm using vb.net. But, till now, I haven't found any helpful article.



请帮忙,我会非常感激。

Kindly assist, I will be really thankful.

此致,SP辛格

推荐答案

Hello Singh,

Hello Singh,

你需要这样做卸载加载项时的相反操作。为此,您需要向安装程序添加自定义操作,并以编程方式创建Word应用程序的实例,您可以在其中找到并删除任何自定义控件。

You need to do the opposite operation when the add-in is uninstalled. For that you need to add a custom action to your installer and create an instance of the Word application programmatically where you can find and remove any custom controls.

请注意,命令栏已弃用且不再使用。我建议使用Fluent UI(Office 2007+)。您可以在以下系列文章中阅读更多相关内容:

Be aware, command bars were deprecated and not used any longer. I'd recommend using the Fluent UI instead (Office 2007+). You can read more about that in the following series of articles:

自定义2007 Office适用于开发人员的流畅功能区(第1部分,共3部分)

自定义2007 Office Fluent Ri bbon for Developers(第2部分,共3部分)

为开发人员自定义2007 Office Fluent功能区(第3部分,共3部分)

卸载加载项时不需要删除控件。

It doesn't require removing controls when the add-in is uninstalled.


这篇关于如何编辑Normal.dotm文件,并使用VB .Net仅删除Addins创建的按钮(程序定义)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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