Salve
Estou tentando gerar um relatorio em world. Eu chego a abrir o arquivo e escrever algumas linhas, porem, quando eu abro mesmo ele vem corrompido, alguem sabe o pq ?
Eis o código
try {
if (args.length > 0) {
HWPFDocument wd = new HWPFDocument(new FileInputStream(args[0]));
Range range = wd.getRange();
range.insertBefore(" ESCREVEU ");
OutputStream out = new FileOutputStream(args[0]);
wd.write(out);
out.close();
System.out.println("TERMINOU");
}
} catch (Exception e) {
e.printStackTrace();
}
Valew