Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

WordHyperLink

OfficeIMO.Word

Namespace
OfficeIMO.Word
Assembly
OfficeIMO.Word
Source revision
0eef6a5756b9 with working tree changes

Represents a hyperlink element within a Word document. Provides helper methods for modifying hyperlink text, formatting, and target information.

Inheritance

Usage

Explore 21 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 3

Methods

AddHyperLink 4 overloads
public WordHyperLink InsertFormattedHyperlinkAfter(string newText, Uri newUri) #

Inserts a hyperlink after this hyperlink and copies this link's formatting.

Parameters

newText string required
Text for the new hyperlink.
newUri System.Uri required
Destination of the new hyperlink.

Returns

WordHyperLink The inserted hyperlink.
public WordHyperLink InsertFormattedHyperlinkBefore(string newText, Uri newUri) #

Inserts a hyperlink before this hyperlink and copies this link's formatting.

Parameters

newText string required
Text for the new hyperlink.
newUri System.Uri required
Destination of the new hyperlink.

Returns

WordHyperLink The inserted hyperlink.
public void Remove(bool includingParagraph = true) #

Removes hyperlink. When specified to remove paragraph it will only do so, if paragraph is empty or contains only paragraph properties.

Parameters

includingParagraph bool = true optional

Properties

public WordParagraph Paragraph { get; } #

Gets the paragraph containing this hyperlink.

public IReadOnlyList<WordParagraph> Runs { get; } #

Gets editable formatted text runs belonging to this hyperlink.

public Uri? Uri { get; set; } #

Gets or sets the URI of the hyperlink.

public string? Id { get; set; } #

Specifies a location in the target of the hyperlink, in the case in which the link is an external link.

public bool IsEmail { get; } #

Indicates whether the hyperlink uses the mailto scheme.

public string EmailAddress { get; } #

Gets the email address if the hyperlink is a mailto link.

public bool History { get; set; } #

Gets or sets whether the hyperlink is marked as visited.

public string? DocLocation { get; set; } #

Specifies a location in the target of the hyperlink, in the case in which the link is an external link.

public string? Anchor { get; set; } #

Specifies the name of a bookmark within the document. See Bookmark. If the attribute is omitted, then the default behavior is to navigate to the start of the document. If the r:id attribute is specified, then the anchor attribute is ignored.

public string? Tooltip { get; set; } #

Gets or sets the tooltip displayed when hovering over the hyperlink.

public WordHyperlinkTargetFrame? TargetFrame { get; set; } #

Gets or sets the target frame for the hyperlink.

public bool IsHttp { get; } #

Gets a value indicating whether the hyperlink uses the HTTP or HTTPS scheme.

public string? Scheme { get; } #

Gets the scheme component of the hyperlink URI.

public string Text { get; set; } #

Gets or sets the display text for the hyperlink.