基本信息
源码名称:word中批注替换和查找替换
源码大小:0.63M
文件格式:.rar
开发语言:C#
更新时间:2019-09-10
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 5 元 
   源码介绍
word文件批注替换和查找替换

 //批注替换
        private void button1_Click(object sender, EventArgs e)
        {
            string oldstr = textBox1.Text;
            string newstr = textBox2.Text;
            string filepath = "";//模板地址
            string savepath = "";//保存地址            
            try
            {            
                filepath = System.Windows.Forms.Application.StartupPath.ToString() "\\文件\\批注替换.doc";
                savepath = System.Windows.Forms.Application.StartupPath.ToString() "\\文件\\NEW_批注替换.doc";
                bool ret =replace_by_comments(oldstr,newstr,filepath, savepath);//导出文件
                if (ret)
                {
                    MessageBox.Show("成功导出证书并上传!", "提示", MessageBoxButtons.OK);
                }
                else
                {
                    MessageBox.Show("导出上传证书失败", "提示", MessageBoxButtons.OK);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("导出数据异常!异常描述:" ex.Message, "提示", MessageBoxButtons.OK);
            }
        }
        //查找替换
        private void button2_Click(object sender, EventArgs e)
        {
            string oldstr = textBox1.Text;
            string newstr = textBox2.Text;
            string filepath = "";//文件地址
            filepath = System.Windows.Forms.Application.StartupPath.ToString() "\\文件\\批注替换.doc";
            WordReplacexia(filepath, oldstr, newstr);
        }