前面我们介绍了如何使用Spire.Doc 为Word文档添加,修改及删除批注。在word 2013及以上版本中,可以对word文档中的批注进行回复。Spire.Doc 可以调用ReplyToComment()方法回复批注。该文将详细介绍如何使用C#, VB.NET回复批注。
C#
Document doc = new Document();
doc.LoadFromFile("Sample.docx");
Comment comment = doc.Comments[0];
Comment replyComment = new Comment(doc);
replyComment.Format.Author = "E-iceblue";
replyComment.Body.AddParagraph().AppendText("回复批注");
comment.ReplyToComment(replyComment);
doc.SaveToFile("ReplyToComment.docx", FileFormat.Docx2013);
VB.NET
Dim doc As New Document()
doc.LoadFromFile("Comment.docx")
Dim comment As Comment = doc.Comments(0)
Dim replyComment As New Comment(doc)
replyComment.Format.Author = "E-iceblue"
replyComment.Body.AddParagraph().AppendText("回复批注");
comment.ReplyToComment(replyComment)
doc.SaveToFile("ReplyToComment.docx", FileFormat.Docx2013)