Word support is not done yet.
Here's an Excel example that reads a workbook, modifies it and writes it
back:
POIFSFileSystem fs =
new POIFSFileSystem(new FileInputStream("workbook.xls"));
HSSFWorkbook wb = new HSSFWorkbook(fs);
HSSFSheet sheet = wb.getSheetAt(0);
HSSFRow row = sheet.getRow(2);
HSSFCell cell = row.getCell((short)3);
if (cell == null)
cell = row.createCell((short)3);
cell.setCellType(HSSFCell.CELL_TYPE_STRING);
cell.setCellValue("a test");
// Write the output to a file
FileOutputStream fileOut = new FileOutputStream("workbook.xls");
wb.write(fileOut);
fileOut.close();
More documentation is available on the web site.
Regards,
Glen Stampoultzis (TriNexus Pty Ltd)
+63 3 9753-6850 0402 835 458
ICQ: 62722370 EMail: [EMAIL PROTECTED]
----- Original Message -----
From: "Stefan Neudorfer" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, March 30, 2002 2:53 PM
Subject: Example for Using POI to import Excel and Word?
> Hi,
>
> we have to import and parse Excel and Word-files and we are looking for
> a way to use POI.
> Does someone have a simple example so that we can look for a way to use
> POI in our applications (Swing, Batch)?
>
>
> Thanks,
>
>
>
> Stefan Neudorfer
>