Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

ReadOnlyHyperlinkCollection Interface

A collection of Hyperlink objects in the document.

Namespace: DevExpress.XtraRichEdit.API.Native

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

Declaration

[ComVisible(true)]
public interface ReadOnlyHyperlinkCollection :
    ISimpleCollection<Hyperlink>,
    IEnumerable<Hyperlink>,
    IEnumerable,
    ICollection

Remarks

Contains a ReadOnlyHyperlinkCollection.Get method that obtains all hyperlinks located in the specified document range. You can access individual items of this collection, but you cannot add or delete items. Use index notation to obtain an individual Hyperlink object from this collection.

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

using (RichEditDocumentServer wordProcessor = new RichEditDocumentServer())
{
    Document document = wordProcessor.Document;
    ReadOnlyHyperlinkCollection hyperlinks = document.Hyperlinks.Get(document.Sections[0].Range);
    if (hyperlinks != null)
    {
        foreach (Hyperlink hyperlink in hyperlinks)
        {
            document.Hyperlinks.Remove(hyperlink);
        }
    }
}
See Also