Further to Yury's post, here is the link to the original discussion in the archive;
http://mail-archives.apache.org/mod_mbox/poi-user/200805.mbox/browser The name of the original poster is Axel Rose and the discussion related to a file embedded into a Word document and I never expected the code to work for you 'straight out of the box'; rather I hoped it would explain some of the concepts behind accessing an embedded document using the POI. --- On Wed, 11/5/08, Yury Batrakov <[EMAIL PROTECTED]> wrote: From: Yury Batrakov <[EMAIL PROTECTED]> Subject: Re: How to read Inserted Objects in EXCEL File To: "POI Users List" <[email protected]> Date: Wednesday, November 5, 2008, 3:46 AM > Can you brief about following functions used > > 1) resolveDir resolveDir returns POIFS DirectoryNode object needed by HSSFWorkbook constructor by its symbolic name. Last time I used POI, the only way to do it in case of nested directories on POIFS, was recursive descend one-by-one: Example: to get DirectoryNode "\dir1\dir2\dir3" we should do filesystem.getRoot().getEntry("dir1").getEntry("dir2").getEntry("dir3"), not filesystem.getRoot().getEntry("dir1\dir2\dir3") > 2) processPOIFSReaderEvent POIFSReaderListener interface allows to register callbacks to process OLE filesystem entries (directories or files), processPOIFSReaderEvent function is called for each of these entries. In this function we get those filenames that end with "Workbook" and do anything that is required for HSSFWorkbook to construct HSSF objects from them. To understand what this code do, I'd propose to: - find and read the whole conversation where this code was posted, you can find some tips about how the problem was being solved - comment whole "if" block "if(name.endsWith("Workbook")..." and run your program to see how embedded documents are represented by POI. - find javadoc for HSSFWorkbook constructors to see what is required to create HSSF objects - read POI source - ????? - PROFIT! :) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
