【自定义WordAddIn插件 】

本文详细介绍了如何使用VS2010创建WordAddIn优快云插件,包括创建工程、添加功能组件、编写代码及运行调试等步骤,演示了在Word文档上实现简单的辅助功能。

启动VS20107679511_201007031658201.jpg

创建一个WordAddIn优快云工程7679511_201007031658202.jpg

创建后我们在工程里再添加一个form1窗体,用于加入我们想要的相关功能7679511_201007031658203.jpg

进入form1界面,插入一个richTextBox1;两个button按钮7679511_201007031658204.jpg

然后在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 ffice = Microsoft.Office.Core;  

using Microsoft.Office.Tools.Word;  

using System.Windows.Forms;  

 

namespace WordAddIn优快云  

{  

    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  

    }  

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Xml.Linq;

using Word = Microsoft.Office.Interop.Word;

using ffice = Microsoft.Office.Core;

using Microsoft.Office.Tools.Word;

using System.Windows.Forms;

 

namespace WordAddIn优快云

{

    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开始调试7679511_201007031658205.jpg

 

 

运行后界面如下,word文档打开了以后,文档上浮着一个office 草稿便签,可以暂时存放我们临时数据,以便捷文档办公;7679511_201007031658206.jpg

您可以根据自己的需要开发适合自己办公的功能插件。

 

fj.png71.JPG

fj.png72.JPG

fj.png73.JPG

fj.png74.JPG

fj.png75.JPG

fj.png76.JPG

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7679511/viewspace-667094/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/7679511/viewspace-667094/

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值