I'm not sure why the escape characters won't create new lines?
MSWord ITSM = new MSWord("C:/users/o519731/Desktop/ITSM.docx"); XWPFParagraph copyITSM = ITSM.Document.createParagraph(); XWPFRun enterText = copyITSM.createRun(); enterText.setText("First line.\n"); enterText.setText("Second line.\n"); enterText.setText("Third line."); ITSM.Document.write(ITSM.wordStream); ITSM.wordStream.close(); System.out.println("Document Created.");
Results in:
First Line.Second line.Third line.
Expecting each on a separate line:
First line. Second line. Third line.