编辑工作表的超链接
Contents
[
Hide
]
Aspose.Cells 允许您使用工作表.超链接收藏。您可以从该集合中逐一访问每个超链接并编辑其属性。
编辑工作表的超链接
以下示例代码访问工作表的所有超链接并更改它们的超链接.地址财产到 Aspose 网站。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getDataDir(EditingHyperlinksOfWorksheet.class); | |
Workbook workbook = new Workbook(dataDir + "source.xlsx"); | |
Worksheet worksheet = workbook.getWorksheets().get(0); | |
for (int i = 0; i < worksheet.getHyperlinks().getCount(); i++) { | |
Hyperlink hl = worksheet.getHyperlinks().get(i); | |
hl.setAddress("http://www.aspose.com"); | |
} | |
workbook.save(dataDir + "output.xlsx"); |