1

我在使用的时候dsoframer操作字有问题。

我可以通过这样的代码添加评论

   Microsoft.Office.Interop.Word.Comment cm = 
word.Comments.Add(word.Application.Selection.Range, "test");
int ctIndex = cm.Index;

但是如何更新评论内容呢?我找不到任何功能来做到这一点!

word.Comments[ctIndex]..
4

1 回答 1

1

Read:

var comments = wordApp.ActiveDocument.Comments;
    foreach (Comment comment in comments)
    {
      var commentText = comment.Range.Text;
      var scopeTxt = comment.Scope.Text;
        Console.WriteLine(commentText);
    }

Do not forget to mark it as answer if this solve your problem ^^

Write:

foreach (Comment comment in comments)
      {
        comment.Range.Text = "Write a new text here";
      }
于 2016-05-24T13:36:27.417 回答