Class Hyperlink
Class Hyperlink
Namespace: Aspose.Cells
Assembly: Aspose.Cells.dll (25.2.0)
Encapsulates the object that represents a hyperlink.
public class Hyperlink
Inheritance
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Examples
//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");
'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")
Properties
Address
Represents the address of a hyperlink.
public string Address { get; set; }
Property Value
Area
Gets the range of hyperlink.
public CellArea Area { get; }
Property Value
LinkType
Gets the link type.
public TargetModeType LinkType { get; }
Property Value
ScreenTip
Returns or sets the ScreenTip text for the specified hyperlink.
public string ScreenTip { get; set; }
Property Value
TextToDisplay
Represents the text to be displayed for the specified hyperlink. The default value is the address of the hyperlink.
public string TextToDisplay { get; set; }
Property Value
Methods
Delete()
Deletes this hyperlink
public void Delete()