Hi everyone,
I'm quite new to docx4j. After installing everything, I tried creating an empty .docx file, and then write text in it. Here's the code :
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.createPackage();
wordMLPackage.getMainDocumentPart().addParagraphOfText("Hello Word!");
wordMLPackage.save(new java.io.File("HelloWord1.docx"));
The file is succesfully created, but when I try to open it with Word 2010, I get an error message saying the file is corrupted. However, when I open it with WordPad, everything is fine, and the text is there. What could I do to solve this problem and open my created documents with Word 2010 ?