الحصول على الارتباطات التشعبية في النطاق
Contents
[
Hide
]
الحصول على الارتباطات التشعبية في النطاق
توفر الفئة Range ما يلي: الخاصية الجلب الذي يحصل على جميع الارتباطات التشعبية في النطاق المحدد. يمكنك أيضًا حذف الارتباط التشعبي عن طريق استدعاء الطريقة Hyperlink.delete().
كود عينة
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 | |
// Instantiate a Workbook object | |
// Open an Excel file | |
Workbook workbook = new Workbook(sourceDir + "HyperlinksSample.xlsx"); | |
// Get the first (default) worksheet | |
Worksheet worksheet = workbook.getWorksheets().get(0); | |
// Create a range A2:B3 | |
Range range = worksheet.getCells().createRange("A2", "B3"); | |
// Get Hyperlinks in range | |
Hyperlink[] hyperlinks = range.getHyperlinks(); | |
for (Hyperlink link : hyperlinks){ | |
System.out.println(link.getArea() + " : " + link.getAddress()); | |
// To delete the link, use the Hyperlink.Delete() method. | |
link.delete(); | |
} | |
workbook.save(outputDir + "HyperlinksSample_out.xlsx"); |