Class HyperlinkCollection

HyperlinkCollection class

Encapsulates a collection of Hyperlink objects.

public class HyperlinkCollection : CollectionBase<Hyperlink>

Properties

NameDescription
Capacity { get; set; }
Count { get; }
Item { get; }Gets the Hyperlink element at the specified index.
Item { get; set; }

Methods

NameDescription
Add(string, int, int, string)Adds a hyperlink to a specified cell or a range of cells.
Add(int, int, int, int, string)Adds a hyperlink to a specified cell or a range of cells.
Add(string, string, string, string, string)Adds a hyperlink to a specified cell or a range of cells.
BinarySearch(Hyperlink)
BinarySearch(Hyperlink, IComparer<Hyperlink>)
BinarySearch(int, int, Hyperlink, IComparer<Hyperlink>)
Clear()Clears all hyperlinks. (2 methods)
Contains(Hyperlink)
CopyTo(Hyperlink[])
CopyTo(Hyperlink[], int)
CopyTo(int, Hyperlink[], int, int)
Exists(Predicate<Hyperlink>)
Find(Predicate<Hyperlink>)
FindAll(Predicate<Hyperlink>)
FindIndex(Predicate<Hyperlink>)
FindIndex(int, Predicate<Hyperlink>)
FindIndex(int, int, Predicate<Hyperlink>)
FindLast(Predicate<Hyperlink>)
FindLastIndex(Predicate<Hyperlink>)
FindLastIndex(int, Predicate<Hyperlink>)
FindLastIndex(int, int, Predicate<Hyperlink>)
GetEnumerator()
IndexOf(Hyperlink)
IndexOf(Hyperlink, int)
IndexOf(Hyperlink, int, int)
LastIndexOf(Hyperlink)
LastIndexOf(Hyperlink, int)
LastIndexOf(Hyperlink, int, int)
RemoveAt(int)Remove the hyperlink at the specified index in this collection. (2 methods)

Examples



[C#]

//Instantiating a Workbook object
Workbook workbook = new Workbook();

//Obtaining the reference of the newly added worksheet by passing its sheet index
Worksheet worksheet = workbook.Worksheets[0];

//Get Hyperlinks Collection
HyperlinkCollection hyperlinks = worksheet.Hyperlinks;

//Adding a hyperlink to a URL at "A1" cell
hyperlinks.Add("A1", 1, 1, "http://www.aspose.com");

//Saving the Excel file
workbook.Save("book1.xls");

[VB.NET]

'Instantiating a Workbook object
Dim workbook As Workbook = New Workbook()

'Obtaining the reference of the newly added worksheet by passing its sheet index
Dim worksheet As Worksheet = workbook.Worksheets(0)

'Get Hyperlinks Collection
Dim hyperlinks As HyperlinkCollection = worksheet.Hyperlinks

'Adding a hyperlink to a URL at "A1" cell
hyperlinks.Add("A1", 1, 1, "http://www.aspose.com")

'Saving the Excel file
workbook.Save("book1.xls")

See Also