Andrew J. Miller wrote:
Hi all!

I'm working on changing a "pretty" spreadsheet into a basic "not-so-pretty-but-easy-to-work-with" spreadsheet and then copy that data into a couple of databases. There are a ton of text boxes within the original "pretty" excel file that contain data I have to use. Does anyone know if it is possible to identify the objects within the sheet (in this case, a text box) and then extract the text from it? I've only found solutions on adding and positioning new text boxes in an excel spreadsheet, not getting info from an existing one...

I can get you part of the way there.

  POIFSFileSystem fileSystem = ...;

  HSSFRequest hssfRequest = new HSSFRequest();
  hssfRequest.addListener(new HSSFListener() {
    public void processRecord(Record record) {
      TextObjectRecord textObject = (TextObjectRecord) record;

      // Do stuff
    }
  }, TextObjectRecord.sid);

  HSSFEventFactory eventFactory = new HSSFEventFactory();
  eventFactory.processWorkbookEvents(hssfRequest, fileSystem);

But we only extract the text, so I don't actually know if TextObjectRecord contains information on what sheet the object is on.

Daniel


--
Daniel Noll

Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
Web: http://www.nuix.com.au/                        Fax: +61 2 9212 6902

This message is intended only for the named recipient. If you are not
the intended recipient you are notified that disclosing, copying,
distributing or taking any action in reliance on the contents of this
message or attachment is strictly prohibited.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/

Reply via email to