Hyperlink classe

Encapsule l’objet qui représente un lien hypertexte.

Le type Hyperlink expose les membres suivants :

Propriétés

Propriété Description
address Représente l’adresse d’un lien hypertexte.
text_to_display Représente le texte à afficher pour le lien hypertexte spécifié. La valeur par défaut est l’adresse du lien hypertexte.
area Obtient la plage de liens hypertexte.
screen_tip Renvoie ou définit le texte de l’info-bulle pour le lien hypertexte spécifié.
link_type Obtient le type de lien.

Méthodes

Méthode Description
delete() Supprime ce lien hypertexte

Exemple

from aspose.cells import Workbook

# Instantiating a Workbook object
workbook = Workbook()
# Adding a new worksheet to the Workbook object
workbook.worksheets.add()
# Obtaining the reference of the newly added worksheet by passing its sheet index
worksheet = workbook.worksheets[0]
# Adding a hyperlink to a URL at "A1" cell
index = worksheet.hyperlinks.add("A1", 1, 1, "http://www.aspose.com")
# Getting a Hyperlink by index.
hyperlink = worksheet.hyperlinks[index]
# Setting display text of this hyperlink.
hyperlink.text_to_display = "Aspose"
# Saving the Excel file
workbook.save("book1.xls")

Voir également