The pptx format file cannot take effect when the comments are modified. The following is sample code: public static void main(String[] args) throws Exception { String filePath = "D:\\test.pptx"; XMLSlideShow slideShow = new XMLSlideShow(new FileInputStream(filePath)); List<XSLFSlide> slides = slideShow.getSlides(); slides.forEach(slide -> { slide.getComments().forEach(e -> { System.out.println(e.getText()); e.setText("Test modification"); }); }); FileOutputStream out = new FileOutputStream(filePath); slideShow.write(out); slideShow.close(); }