ワークシートのハイパーリンクの編集
Contents
[
Hide
]
Aspose.Cells を使用すると、ワークシートのすべてのハイパーリンクにアクセスできます。ワークシート.ハイパーリンクコレクション。このコレクションの各ハイパーリンクに 1 つずつアクセスして、そのプロパティを編集できます。
ワークシートのハイパーリンクの編集
次のサンプル コードは、ワークシートのすべてのハイパーリンクにアクセスし、それらのハイパーリンクを変更します。Hyperlink.AddressAspose ウェブサイトへのプロパティ。
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"); |