الحصول على الارتباطات التشعبية في النطاق
Contents
[
Hide
]
الحصول على الارتباطات التشعبية في النطاق
للحصول على الروابط الفائقة في النطاق، استخدم خاصية getHyperlinks() لفئة Range. تُستخدم خاصية getHyperlinks() للحصول على جميع الروابط الفائقة في النطاق المحدد.
يُظهر مقتطف الكود التالي كيفية الحصول على جميع الروابط الفائقة في النطاق المحدد.
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
source_directory = "Examples/SampleFiles/SourceDirectory/" | |
# Load Source Excel file | |
workbook = Workbook(source_directory + "HyperlinksSample.xlsx") | |
# Access first worksheet | |
worksheet = workbook.getWorksheets().get(0) | |
# Create a range A2:B3 | |
range = worksheet.getCells().createRange("A2", "B3") | |
# Get Hyperlinks in range | |
hyperlinks = range.getHyperlinks() | |
for link in hyperlinks: | |
print(str(link.getArea()) + " : " + str(link.getAddress())) |