We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

TextBox and Comments detection

Hi, I have problem detecting TextBoxes and Comments. Here is code snippet:
Workbook workbook = new Workbook();


Worksheets worksheets = workbook.getWorksheets();

Worksheet worksheet = worksheets.getSheet(0);

TextBoxes textBoxes = worksheet.getTextBoxes();

for (int i = 0; i < textBoxes.size(); i++) {
TextBox textBox = textBoxes.get(i);

System.out.println("textBox " + textBox.getContent()); // no TextBox detected

Comments comments = worksheet.getComments();

for (int i = 0; i < comments.size(); i++) {
Comment comment = comments.get(i);

System.out.println("comment " + comment.getNote()); // no Comment detected

There is test file in an attachment.

I also have question on how to detect font formatting of a comment or text box?

Thanks, Ivica

Seems like, your question is related to Aspose.Cells, so I will move your post to Aspose.Cells forum.

Yes, I am sorry.


Hi Ivica,

Please use Workbook.open() replace the Workbook.loadData(), loadData() will ignore all Shape related objects when read template file in.

To get Font formatting of Textbox or Comment, you can use getFont(), if there is richtext in Textbox or Comment, please use getCharacters(). the API getCharacters() was added from version, if your Aspose.Cells for Java current using is before that, you can get our latest fix from https://forum.aspose.com/t/85881. Thank you.