[Resolved as Invalid] How to read multiple hyperlinks on the same cell

I have a cell containing long text, in which, there are multiple hyperlinks.
I obviously can use getCharacters() to loop over different formats in this cell. But I wonder if there is a way to detect whether it has hyperlink or not.


This message was posted using Page2Forum from Hyperlink (Aspose.Cells for Java API Specification) - Aspose.Cells for Java

Hi Peter,

You can find all of the Hyperlinks jn a worksheet from Worksheet.getHyperlinks() collection.

But how do I identify which part of the text in the cell (i.e. start index) containing hyperlink?
For example:
I may have a cell containing the following text:

“Go to Aspose Forum to know more about Aspose product.”

The first word “Aspose” contains a hyperlink.
And the second word “Aspose” contains a different hyperlink.

Using Worksheet.getHyperlinks(), I am able to identify different links as well as the the text labels. Also I can I identify which cell the links are (I could use function Hyperlinks.getCellArea() to handle this although it may not return exact cell without further checking)

However, is there a way to identify the exact position (starting index) within the string text where the text is linked?

Hi Peter,

Thanks for providing the example. I am trying to create such a file in Excel 2007, in which single cell contains the two links like you stated.

“Go to Aspose Forum to know more about Aspose product.”

But, I can’t create such a file. Can you please create such a file and attach here, so that I could look into it using Aspose.Cells Api(s).

Hi

As you said, I just realize that it is not doable in Excel (I used Excel 2000/XP). As long as I save and close the file, then re-open it, both hyperlinks in the same cell are gone. I didn’t realize it earlier because I have the file open all the time.
This topic shall be invalid for now.

Thank you for your support.
Regards,
Peter

P.S: FWI, OpenOffice odt format actually allow multiple hyperlinks on the same cell. It is a shame Excel cannot support it yet.

Hi Peter,

Thanks for letting me know this information.