ITextRange.Link ITextRange.Link ITextRange.Link ITextRange.Link Property


Gets or sets the URL text associated with a text range.

public : Platform::String Link { get; set; }
winrt::hstring Link();

void Link(winrt::hstring link);
public string Link { get; set; }
Public ReadWrite Property Link As string

Property Value

string string

The URL as text.


This method sets the start and end of the text range to include the entire hyperlink, including the friendly name, if any.

The URL string isn't validated. The text it contains must be enclosed in quotes, optionally preceded by the sentinel character 0xFDDF. For example: "" or 0xFDDF"".

The text range must be nondegenerate. The following actions are possible:

  • If part of a link's friendly name is selected, the URL part is replaced with the Link property value.
  • If part of a regular URL is selected, it becomes the link's friendly name, with the Link property value as the URL.
  • If nonlink text is selected: + If the text immediately follows a link's friendly name and the Link property value matches the URL, the text is appended to the friendly name.
    • Otherwise, the text becomes the friendly name of a link with the Link property value as the URL.

The text range can be adjusted to different character positions after this method is called.