Java 回复Word批注
1、Step 1: 通过官网下载jar文件包后,解压;
Step 2: 在程序中新建一个Directory目录,并命名;
Step 3: 将解压后文件lib中的Spire.Doc.jar文件复制到新建的目录下;
Step 4: 鼠标选中复制后的jar文件,右键,选中“Add as Library”,完成导入。
1、import com.spire.doc.*;
import com.spire.doc.fields.Comment;
public class ReplyComment {
public static void main(String[] args) throws Exception{
//加载测试文档
Document doc = new Document("AddComment.docx");
//获取指定批注
Comment comment = doc.getComments().get(0);
//回复批注
Comment relyC= new Comment(doc);
relyC.getFormat().setAuthor("实验组");
relyC.getBody().addParagraph().appendText("已完成。");
comment.replyToComment(relyC);
//保存文档
doc.saveToFile("ReplyComment.docx",FileFormat.Docx_2010);
}
}
2、批注回复效果:

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:122
阅读量:111
阅读量:98
阅读量:138
阅读量:50