Aralıktaki Bağlantıları Al
Contents
[
Hide
]
Aralıktaki Bağlantıları Al
Seçilen aralıktaki tüm bağlantıları almak için, Range sınıfı getHyperlinks() özelliği getter sağlar. Ayrıca Hyperlink.delete() yöntemini çağırarak Bağlantıyı silebilirsiniz.
Örnek Kod
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"); |