Thanks for your quick answer,

I tried this code with this file  :
for(HSSFShape shape : wb.getSheetAt(1).getDrawingPatriarch().getChildren()) {
                        System.out.println(">> " + shape.toString());
                        if(shape instanceof HSSFTextbox) {
                                HSSFTextbox txtBox = (HSSFTextbox) shape;
                                System.out.println("-- 
"+txtBox.getString().length() +
txtBox.getString().toString());
                        }
                        
                }

But the text is always empty :
>> org.apache.poi.hssf.usermodel.HSSFTextbox@61542a75
-- 0

Any idea why ?

Denis

2012/6/20 Yegor Kozlov <[email protected]>:
> Try to iterate over shapes in sheet.getDrawingPatriarch().getChildren().
> Check if a object is HSSFTextbox and then retrive its position via
> shape.getAnchor().
>
> Yegor
>
> On Wed, Jun 20, 2012 at 12:21 PM, Denis Delangle
> <[email protected]> wrote:
>> Hello,
>>
>> First of all I am an happy user of POI (using it intensively during
>> last 2 years on various Excel files to extract data) stuck for the
>> first time. So thanks for this nice peace of software.
>>
>> I would like to extract text zones from my Excel file but I really
>> need to know to which sheet the text zone belongs to.
>>
>> I tried this method to get all the text zones from a workbook using
>> TextObjectRecord and HSSFRequest :
>> http://article.gmane.org/gmane.comp.jakarta.poi.user/8549/match=textobjectrecord
>> But I don't have sheet information.
>>
>> Do you know if there is a way to get it ?
>>
>> Regards,
>>
>> Denis
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>

Attachment: testZonesTexte.xls
Description: MS-Excel spreadsheet

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to