Back to Devexpress

SubDocument.FindAll(String, SearchOptions, DocumentRange) Method

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-subdocument-dot-findall-x28-system-dot-string-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-searchoptions-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-documentrange-x29.md

latest6.5 KB
Original Source

SubDocument.FindAll(String, SearchOptions, DocumentRange) Method

Finds all text ranges that match the specified string in the specified document range.

Namespace : DevExpress.XtraRichEdit.API.Native

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
DocumentRange[] FindAll(
    string textToFind,
    SearchOptions options,
    DocumentRange range
)
vb
Function FindAll(
    textToFind As String,
    options As SearchOptions,
    range As DocumentRange
) As DocumentRange()

Parameters

NameTypeDescription
textToFindString

A string, specifying the search text.

| | options | SearchOptions |

A SearchOptions enumeration specifying search options.

| | range | DocumentRange |

A DocumentRange object specifying the range in the document in which a search is performed.

|

Returns

TypeDescription
DocumentRange[]

An array of DocumentRange objects representing matching text ranges.

|

The following code snippets (auto-collected from DevExpress Examples) contain references to the FindAll(String, SearchOptions, DocumentRange) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-richedit-document-api/CS/RichEditAPISample/CodeExamples/Comments.cs#L22

csharp
if (document.Comments.Count > 0) {
    DocumentRange[] resRanges = document.FindAll("trump", SearchOptions.None, document.Comments[1].Range);
    if (resRanges.Length > 0) {

wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/CommentsActions.cs#L30

csharp
if (document.Comments.Count > 0) {
    DocumentRange[] resRanges = document.FindAll("trump", SearchOptions.None, document.Comments[1].Range);
    if (resRanges.Length > 0) {

word-document-api-examples/CS/CodeExamples/CommentsActions.cs#L56

csharp
// to which the parent comment relates.
DocumentRange[] resRanges = document.FindAll("trump", SearchOptions.None, document.Comments[1].Range);
if (resRanges.Length > 0)

word-document-api-use-layout-api-to-manage-document-pages/CS/Program.cs#L44

csharp
DocumentRange pageDocumentRange = GetPageDocumentRange(rtfProcessor, pageNumber);
DocumentRange[] words = rtfProcessor.Document.FindAll(text, SearchOptions.WholeWord, pageDocumentRange);
return words;

winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/Comments.vb#L21

vb
If document.Comments.Count > 0 Then
    Dim resRanges As DevExpress.XtraRichEdit.API.Native.DocumentRange() = document.FindAll("trump", DevExpress.XtraRichEdit.API.Native.SearchOptions.None, document.Comments(CInt((1))).Range)
    If resRanges.Length > 0 Then

wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/CommentsActions.vb#L28

vb
If document.Comments.Count > 0 Then
    Dim resRanges() As DocumentRange = document.FindAll("trump", SearchOptions.None, document.Comments(1).Range)
    If resRanges.Length > 0 Then

word-document-api-examples/VB/CodeExamples/CommentsActions.vb#L50

vb
' to which the parent comment relates.
Dim resRanges As DevExpress.XtraRichEdit.API.Native.DocumentRange() = document.FindAll("trump", DevExpress.XtraRichEdit.API.Native.SearchOptions.None, document.Comments(CInt((1))).Range)
If resRanges.Length > 0 Then

word-document-api-use-layout-api-to-manage-document-pages/VB/Program.vb#L33

vb
Dim pageDocumentRange As DocumentRange = GetPageDocumentRange(rtfProcessor, pageNumber)
Dim words() As DocumentRange = rtfProcessor.Document.FindAll(text, SearchOptions.WholeWord, pageDocumentRange)
Return words

See Also

SubDocument Interface

SubDocument Members

DevExpress.XtraRichEdit.API.Native Namespace