If we do something like... richText[k].setRawText(richText[k].getRawText().replace("[SYSDATE2]", "REPLACED_DATE2")); We'll get a string out of bounds exception generated from within the setRawText method. eg. Problem with slide show String index out of range: 51 java.lang.StringIndexOutOfBoundsException: String index out of range: 51 at java.lang.String.substring(String.java:1765) at org.apache.poi.hslf.usermodel.RichTextRun.getRawText(RichTextRun.java:158) at org.apache.poi.hslf.model.TextRun.changeTextInRichTextRun(TextRun.java:435) at org.apache.poi.hslf.usermodel.RichTextRun.setRawText(RichTextRun.java:174) at com.globoforce.scheduled.App.main(App.java:34)
*** This bug has been marked as a duplicate of bug 45088 ***