Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

HyperlinkCollection.Remove(Hyperlink) Method

Converts a hyperlink to plain text.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v24.2.Core.dll

NuGet Package: DevExpress.RichEdit.Core

#Declaration

void Remove(
    Hyperlink hyperlink
)

#Parameters

Name Type Description
hyperlink Hyperlink

A Hyperlink to convert.

#Example

The code sample below locates and removes all hyperlinks in the first section:

using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;

using (var wordProcessor = new RichEditDocumentServer())
{
    // Load a document
    wordProcessor.LoadDocument("Documents//Document.docx");
    Document document = wordProcessor.Document;

    // Obtain all hyperlinks in the first section
    var hyperlinks = document.Hyperlinks.Get(document.Sections[0].Range);
    if (hyperlinks != null)
    {
        // Remove all hyperlinks
        foreach (Hyperlink hyperlink in hyperlinks)
        {
            document.Hyperlinks.Remove(hyperlink);
        }
    }
}
See Also