officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-88bd99a4.md
A collection of Hyperlink objects in the document.
Namespace : DevExpress.XtraRichEdit.API.Native
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
[ComVisible(true)]
public interface ReadOnlyHyperlinkCollection :
ISimpleCollection<Hyperlink>,
IEnumerable<Hyperlink>,
IEnumerable,
ICollection
<ComVisible(True)>
Public Interface ReadOnlyHyperlinkCollection
Inherits ISimpleCollection(Of Hyperlink),
IEnumerable(Of Hyperlink),
IEnumerable,
ICollection
The following members return ReadOnlyHyperlinkCollection objects:
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);
}
}
}
Using wordProcessor As New RichEditDocumentServer()
Dim document As Document = wordProcessor.Document
Dim hyperlinks As ReadOnlyHyperlinkCollection = document.Hyperlinks.Get(document.Sections(0).Range)
If hyperlinks IsNot Nothing Then
For Each hyperlink As Hyperlink In hyperlinks
document.Hyperlinks.Remove(hyperlink)
Next hyperlink
End If
End Using
See Also
ReadOnlyHyperlinkCollection Members