Back to Devexpress

HyperlinkBase.IsExternal Property

officefileapi-devexpress-dot-spreadsheet-dot-hyperlinkbase-839a1a5c.md

latest5.9 KB
Original Source

HyperlinkBase.IsExternal Property

Gets a value that indicates whether the hyperlink refers to an external resource (web page, e-mail address, file or directory) or to a cell range within the current workbook.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Spreadsheet.v25.2.Core.dll

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
bool IsExternal { get; }
vb
ReadOnly Property IsExternal As Boolean

Property Value

TypeDescription
Boolean

true , if the hyperlink refers to an external resource; otherwise, false.

|

Remarks

When associating a hyperlink with a cell range or picture, you call either the HyperlinkCollection.Add or Shape.InsertHyperlink method respectively, and pass the hyperlink destination (HyperlinkBase.Uri) and a parameter that indicates whether the hyperlink refers to an external resource or to a location within the current workbook. This parameter value is assigned to the IsExternal property.

Example

This example demonstrates how to create a hyperlink to a web page or cell range in a workbook. To do this, use the HyperlinkCollection.Add method with the cell or cell range into which a hyperlink should be inserted, the target web page, or the workbook location passed along with other parameters.

Important

The maximum number of hyperlinks in a worksheet is 65,530.

All hyperlinks created in a worksheet are contained in the HyperlinkCollection collection returned by the Worksheet.Hyperlinks property. To adjust an existing hyperlink, use properties of the Hyperlink object, which can be accessed by the hyperlink index from the HyperlinkCollection collection. To get all hyperlinks contained in the specified cell range, use the HyperlinkCollection.GetHyperlinks method.

To remove hyperlinks, use the HyperlinkCollection.Remove, HyperlinkCollection.RemoveAt or HyperlinkCollection.Clear method. The Worksheet.ClearHyperlinks method deletes all hyperlinks from the specified range of cells.

View Example

csharp
// Create a hyperlink to a web page.
Cell cell = worksheet.Cells["A1"];
worksheet.Hyperlinks.Add(cell, "https://www.devexpress.com/", true, "DevExpress");

// Create a hyperlink to a cell range in a workbook.
CellRange range = worksheet.Range["C3:D4"];
Hyperlink cellHyperlink = worksheet.Hyperlinks.Add(range, "'Sheet2'!B2:E7", false, "Select Range");
cellHyperlink.TooltipText = "Click Me";
vb
' Create a hyperlink to a web page.
Dim cell As Cell = worksheet.Cells("A1")
worksheet.Hyperlinks.Add(cell, "https://www.devexpress.com/", True, "DevExpress")

' Create a hyperlink to a cell range in a workbook.
Dim range As CellRange = worksheet.Range("C3:D4")
Dim cellHyperlink As Hyperlink = worksheet.Hyperlinks.Add(range, "'Sheet2'!B2:E7", False, "Select Range")
cellHyperlink.TooltipText = "Click Me"

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the IsExternal property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

office-file-api-ai-implementation/CS/Controllers/AccessibilityController.cs#L138

csharp
{
    if (hyperlink.IsExternal && (string.IsNullOrEmpty(hyperlink.TooltipText) || hyperlink.TooltipText == hyperlink.Uri))
        hyperlink.TooltipText = await hyperlinkHelper.DescribeHyperlinkAsync(hyperlink.Uri);

See Also

Uri

SetUri(String, Boolean)

HyperlinkBase Interface

HyperlinkBase Members

DevExpress.Spreadsheet Namespace