NativeExcel2 for .Net Developer's Reference

IHyperlinks Interface

Represents the collection of hyperlinks for a worksheet or range. Each hyperlink is represented by an IHyperlink interface.

For a list of all members of this type, see IHyperlinks Members.

[Visual Basic]
PublicInterfaceIHyperlinks
ImplementsIEnumerable
[C#]
publicinterfaceIHyperlinks:IEnumerable
[C++]
public__gc__interfaceIHyperlinks: publicIEnumerable
[JScript]
publicinterfaceIHyperlinksextendsIEnumerable

Remarks

Use the IWorksheet.Hyperlinks property to return the IHyperlinks collection for the specified sheet.

Use the IRange.Hyperlinks property to return the IHyperlinks collection for the specified range.

The following example deletes the hyperlinks on worksheet one for a link that contains the word "Microsoft" in the TextToDisplay.

[C#]
IWorksheet sheet = book.Worksheets[1];
if (sheet.Hyperlinks.Count > 0) {
    for (int i = sheet.Hyperlinks.Count; i > 0; i--) {
        if (sheet.Hyperlinks[i].TextToDisplay.IndexOf("Microsoft") >= 0)
            sheet.Hyperlinks[i].Delete();
    }       
}

Use the Add method to create a hyperlink and add it to the Hyperlinks collection. The following example creates a new hyperlink for cell A8.

[C#]
IWorksheet sheet = book.Worksheets[1];
sheet.Hyperlinks.Add("A8", "http://www.nika-soft.com/");

Requirements

Namespace: NativeExcel

Assembly: NativeExcel (in NativeExcel.dll)

See Also

IHyperlinks Members | NativeExcel Namespace | IWorksheet.Hyperlinks Property | IRange.Hyperlinks Property