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

 

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);
            }

posted @ 2015-08-27 18:05  无处安放的青春  阅读(760)  评论(0编辑  收藏  举报