Hyperlink

Encapsulates the object that represents a hyperlink.

public class Hyperlink

Properties

Name Description
Address { get; set; } Represents the address of a hyperlink.
Area { get; } Gets the range of hyperlink.
LinkType { get; } Gets the link type.
ScreenTip { get; set; } Returns or sets the ScreenTip text for the specified hyperlink.
TextToDisplay { get; set; } Represents the text to be displayed for the specified hyperlink. The default value is the address of the hyperlink.

Methods

Name Description
Delete() Deletes this hyperlink

Examples


[C#]

//Instantiating a Workbook object
Workbook workbook = new 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 worksheet = workbook.Worksheets[0];
//Adding a hyperlink to a URL at "A1" cell
int index = worksheet.Hyperlinks.Add("A1", 1, 1, "http://www.aspose.com");
//Getting a Hyperlink by index.
Hyperlink hyperlink = worksheet.Hyperlinks[index];
//Setting display text of this hyperlink.
hyperlink.TextToDisplay = "Aspose";
//Saving the Excel file
workbook.Save("book1.xls");

[Visual Basic]

'Instantiating a Workbook object
Dim workbook As Workbook = New 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
Dim worksheet As Worksheet = workbook.Worksheets(0)
'Adding a hyperlink to a URL at "A1" cell
Dim index as Integer = worksheet.Hyperlinks.Add("A1", 1, 1, "http://www.aspose.com")
'Getting a Hyperlink by index.
Dim hyperlink as Hyperlink = worksheet.Hyperlinks(index);
'Setting display text of this hyperlink.
hyperlink.TextToDisplay = "Aspose";
'Saving the Excel file
workbook.Save("book1.xls")

See Also