word中替换被批注的正文的值

            try
            {
                Word.Document document = (Word.Document)dsoWord.ActiveDocument;
                foreach (Word.Comment var in document.Comments)
                {
                    var.Scope.Text = "替换被批注正文的值";

                    //var.Range.Text = textBox1.Text;//替换批注的值
                }
                document.Save();
            }
            catch (Exception)
            {
                MessageBox.Show(this, "替换值失败!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
       

 

发布了28 篇原创文章 · 获赞 15 · 访问量 11万+

猜你喜欢

转载自blog.csdn.net/z3h0a5n8g8x9i9a2o3/article/details/9032165