|
我们来演示一下在office2010里面加入我们自定义的插件,比如加入一个便签功能的插件,在我们进行书写文档的时候便捷的编辑文字和记录临时一些数据之用。 启动VS2010 ![]() 创建一个WordAddInCSDN工程 ![]() 创建后我们在工程里再添加一个form1窗体,用于加入我们想要的相关功能 ![]() 进入form1界面,插入一个richTextBox1;两个button按钮 ![]() 然后在ThisAddIn.cs中写入如下代码: using System;
using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; using Word = Microsoft.Office.Interop.Word; using Office = Microsoft.Office.Core; using Microsoft.Office.Tools.Word; using System.Windows.Forms; namespace WordAddInCSDN { public partial class ThisAddIn { private void ThisAddIn_Startup(object sender, System.EventArgs e) { Form1 frm = new Form1(); frm.Show(); } private void ThisAddIn_Shutdown(object sender, System.EventArgs e) { } #region VSTO generated code private void InternalStartup() { this.Startup += new System.EventHandler(ThisAddIn_Startup); this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown); } #endregion } } 按下F5开始调试 ![]() 运行后界面如下,word文档打开了以后,文档上浮着一个office 草稿便签,可以暂时存放我们临时数据,以便捷文档办公; ![]() 您可以根据自己的需要开发适合自己办公的功能插件。 (责任编辑:admin) |





