From a41b81e9ed3d95e173b7b1504d039942c59e4217 Mon Sep 17 00:00:00 2001 From: Kalaivannan-Ganesan <93248069+Kalaivannan-Ganesan@users.noreply.github.com> Date: Mon, 27 Jul 2026 08:47:18 +0530 Subject: [PATCH] Addressed error logs from Find and Replace to the List MD files --- .../Word-Processor/wpf/Find-and-Replace.md | 82 ++++++++---- .../Word/Word-Processor/wpf/Hyperlink.md | 41 ++++-- .../Word/Word-Processor/wpf/Image.md | 48 +++++-- .../Word-Processor/wpf/Import-and-Export.md | 118 ++++++++++++------ .../Word/Word-Processor/wpf/Layout-Types.md | 45 ++++--- .../Word/Word-Processor/wpf/List.md | 110 ++++++++++------ 6 files changed, 307 insertions(+), 137 deletions(-) diff --git a/Document-Processing/Word/Word-Processor/wpf/Find-and-Replace.md b/Document-Processing/Word/Word-Processor/wpf/Find-and-Replace.md index 4c9a53bde3..4f46467e8c 100644 --- a/Document-Processing/Word/Word-Processor/wpf/Find-and-Replace.md +++ b/Document-Processing/Word/Word-Processor/wpf/Find-and-Replace.md @@ -4,15 +4,20 @@ description: Learn here all about Find and Replace support in Syncfusion WPF Ric platform: document-processing control: SfRichTextBoxAdv documentation: ug -keywords: search,find,replace-text +keywords: search,find,replace-text,find-options,regex-find --- # Find and Replace in WPF RichTextBox (SfRichTextBoxAdv) -The [WPF RichTextBox](https://www.syncfusion.com/docx-editor-sdk/wpf-docx-editor) (SfRichTextBoxAdv) control supports searching text contents in the document. This when used in combination with selection becomes a powerful tool enabling scenarios like highlighting specific parts of the document, applying formatting such as bold or replacing text. You can extend your search by using regular expression to find particular pattern of text in the document. +The [WPF RichTextBox](https://www.syncfusion.com/docx-editor-sdk/wpf-docx-editor) (SfRichTextBoxAdv) control supports searching text contents in the document. When combined with selection, it becomes a powerful tool for highlighting specific parts of the document, applying formatting such as bold, or replacing text. You can extend your search by using regular expressions to find a particular pattern of text in the document. + +The find and replace operations are exposed through the [Find](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_Windows_Controls_RichTextBoxAdv_SfRichTextBoxAdv_Find_System_String_Syncfusion_Windows_Controls_RichTextBoxAdv_FindOptions_), [FindAll](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_Windows_Controls_RichTextBoxAdv_SfRichTextBoxAdv_FindAll_System_String_Syncfusion_Windows_Controls_RichTextBoxAdv_FindOptions_), and [FindOptions](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.FindOptions.html) API members. + +## Find + The following code example explains how to find the first occurrence of a particular text in the document and apply bold formatting. {% tabs %} {% highlight c# %} -// Finds the first occurrence of specified text that matches case in RichTextBoxAdv document from current selection. +// Finds the first occurrence of a specified text that matches case in SfRichTextBoxAdv document from current selection. TextSearchResult textSearchResult = richTextBoxAdv.Find("Panda", FindOptions.CaseSensitive); // Selects the text search result. @@ -23,11 +28,11 @@ richTextBoxAdv.Selection.CharacterFormat.Bold = true; {% endhighlight %} {% highlight VB %} -' Finds the first occurrence of specified text that matches case in RichTextBoxAdv document from current selection. +' Finds the first occurrence of a specified text that matches case in SfRichTextBoxAdv document from current selection. Dim textSearchResult As TextSearchResult = richTextBoxAdv.Find("Panda", FindOptions.CaseSensitive) ' Selects the text search result. -richTextBoxAdv.Selection.[Select](textSearchResult.Start, textSearchResult.[End]) +richTextBoxAdv.Selection.Select(textSearchResult.Start, textSearchResult.[End]) ' Applies Bold formatting for the current selection. richTextBoxAdv.Selection.CharacterFormat.Bold = True @@ -37,10 +42,22 @@ richTextBoxAdv.Selection.CharacterFormat.Bold = True {% endtabs %} -The following code example demonstrates how to find all occurrences of a particular pattern of text in the document and highlighting the result. +The `Find` method accepts a [FindOptions](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.FindOptions.html) value that controls how the search is performed. The following flags are available: + +| Flag | Description | +|------|-------------| +| `None` | Performs a case-insensitive search without whole-word matching (default behavior). | +| `CaseSensitive` | Performs a search that matches the exact case of the search text. | +| `WholeWord` | Performs a search that matches only whole words. | + +N> When `CaseSensitive` is not specified, the search is case-insensitive by default. + +## Find all + +The following code example demonstrates how to find all occurrences of a particular pattern of text in the document and highlight the result. {% tabs %} {% highlight c# %} -// Finds all the words that starts with ‘S’ in RichTextBoxAdv document. +// Finds all the words that start with ‘S’ in SfRichTextBoxAdv document. TextSearchResults textSearchResults = richTextBoxAdv.FindAll(new Regex(@"\bS\S*"), FindOptions.None); // If any text search results found. @@ -48,34 +65,32 @@ if (textSearchResults != null) { for (int j = 0; j < textSearchResults.Count; j++) { - TextSearchResult textSearchResult = textSearchResults[j]; // Adds the search result text positions to the selection. richTextBoxAdv.Selection.SelectionRanges.Add(textSearchResult.Start, textSearchResult.End); } - -// Apply highlight color for the selection. + + // Applies highlight color to all selected ranges. richTextBoxAdv.Selection.CharacterFormat.HighlightColor = HighlightColor.Yellow; } {% endhighlight %} {% highlight VB %} -' Finds all the words that starts with ‘S’ in RichTextBoxAdv document. +' Finds all the words that start with ‘S’ in SfRichTextBoxAdv document. Dim textSearchResults As TextSearchResults = richTextBoxAdv.FindAll(New Regex("\bS\S*"), FindOptions.None) ' If any text search results found. If textSearchResults IsNot Nothing Then - For j As Integer = 0 To textSearchResults.Count - 1 - - Dim textSearchResult As TextSearchResult = textSearchResults(j) + For j As Integer = 0 To textSearchResults.Count - 1 + Dim textSearchResult As TextSearchResult = textSearchResults(j) - ' Adds the search result text positions to the selection. - richTextBoxAdv.Selection.SelectionRanges.Add(textSearchResult.Start, textSearchResult.[End]) - Next + ' Adds the search result text positions to the selection. + richTextBoxAdv.Selection.SelectionRanges.Add(textSearchResult.Start, textSearchResult.[End]) + Next - ' Apply highlight color for the selection. - richTextBoxAdv.Selection.CharacterFormat.HighlightColor = HighlightColor.Yellow + ' Applies highlight color to all selected ranges. + richTextBoxAdv.Selection.CharacterFormat.HighlightColor = HighlightColor.Yellow End If @@ -83,10 +98,15 @@ End If {% endtabs %} +The example above applies a [HighlightColor](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.HighlightColor.html) to the selected ranges. The supported values are `Black`, `Blue`, `Cyan`, `Green`, `Magenta`, `Red`, `Yellow`, `White`, and `None` (which clears an existing highlight). + ## Replacing existing text -You can replace a single occurrence or all occurrences of a particular text or pattern of text in a document with another text by performing search operation. This helps you to modify the contents easily. -The following code example demonstrates how to replace a single occurrence of a text with another text in SfRichTextBoxAdv. +You can replace a single occurrence or all occurrences of a particular text or pattern of text in a document with another text by performing a search operation. This makes it easy to modify the document contents. + +### Replace a single occurrence + +The following code example demonstrates how to replace a single occurrence of a text with another text in SfRichTextBoxAdv. The [`TextSearchResult.Replace(string)`](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.TextSearchResults.html#Syncfusion_Windows_Controls_RichTextBoxAdv_TextSearchResults_Replace_System_String_) method takes the replacement text as its argument and replaces the matched text in the current result. {% tabs %} {% highlight c# %} // Finds the text "colour" that matches whole word in the document. @@ -111,7 +131,9 @@ End If {% endtabs %} -The following code example demonstrates how to replace all occurrences of a particular text with another text in SfRichTextBoxAdv. +### Replace all occurrences + +The following code example demonstrates how to replace all occurrences of a particular text with another text in SfRichTextBoxAdv. The [`TextSearchResults.ReplaceAll(string)`](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.TextSearchResults.html#Syncfusion_Windows_Controls_RichTextBoxAdv_TextSearchResults_ReplaceAll_System_String_) method takes the replacement text as its argument and applies it to every match returned by `FindAll`. {% tabs %} {% highlight c# %} // Finds the text "analyse" that matches whole word in the document. @@ -138,8 +160,10 @@ End If ## Options Pane -The SfRichTextBoxAdv provides the built-in options pane support to find the text and navigate to text results similar to Microsoft Word application. -The following code example demonstrates how to show the options pane in SfRichTextBoxAdv through command binding. +The SfRichTextBoxAdv provides built-in options pane support to find text and navigate through the search results, similar to that of Microsoft Word. + +The following code example demonstrates how to show the options pane in SfRichTextBoxAdv through the [ShowOptionsPaneCommand](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_Windows_Controls_RichTextBoxAdv_SfRichTextBoxAdv_ShowOptionsPaneCommand) routed UI command. + {% tabs %} {% highlight xaml %} @@ -149,6 +173,12 @@ The following code example demonstrates how to show the options pane in SfRichTe {% endhighlight %} {% endtabs %} -![WPF RichTextBox displays Find option](Find-and-Replace_images/wpf-richtextbox-find-option.jpeg) +![WPF RichTextBox displays the Find option pane with the search input and navigation controls](Find-and-Replace_images/wpf-richtextbox-find-option.jpeg) + +N> You can refer to our [WPF RichTextBox](https://www.syncfusion.com/docx-editor-sdk/wpf-docx-editor) feature tour page for its groundbreaking feature representations. You can also explore our [WPF RichTextBox example](https://github.com/syncfusion/docx-editor-sdk-wpf-demos) to know how to render and configure the editing tool. + +## See Also -N> You can refer to our [WPF RichTextBox](https://www.syncfusion.com/docx-editor-sdk/wpf-docx-editor) feature tour page for its groundbreaking feature representations.You can also explore our [WPF RichTextBox example](https://github.com/syncfusion/docx-editor-sdk-wpf-demos) to knows how to render and configure the editing tools. \ No newline at end of file +- [Selection in WPF RichTextBox](./Selection) +- [Commands in WPF RichTextBox](./Commands) +- [Document Structure in WPF RichTextBox](./Document-Structure) \ No newline at end of file diff --git a/Document-Processing/Word/Word-Processor/wpf/Hyperlink.md b/Document-Processing/Word/Word-Processor/wpf/Hyperlink.md index ebf4e64752..55975ebf74 100644 --- a/Document-Processing/Word/Word-Processor/wpf/Hyperlink.md +++ b/Document-Processing/Word/Word-Processor/wpf/Hyperlink.md @@ -4,12 +4,18 @@ description: Learn here all about Hyperlink support in Syncfusion WPF RichTextBo platform: document-processing control: SfRichTextBoxAdv documentation: ug -keywords: hyperlink +keywords: hyperlink,insert-hyperlink,screen-tip,request-navigate --- # Hyperlink in WPF RichTextBox (SfRichTextBoxAdv) -The [WPF RichTextBox](https://www.syncfusion.com/docx-editor-sdk/wpf-docx-editor) (SfRichTextBoxAdv) supports hyperlink field similar to the Microsoft Word. You can link part of the document content to Internet or file location, mail address or any text. +The [WPF RichTextBox](https://www.syncfusion.com/docx-editor-sdk/wpf-docx-editor) (SfRichTextBoxAdv) supports hyperlink fields similar to Microsoft Word. You can link part of the document content to the Internet, a file location, an email address, or any other text. + +## Insert hyperlink + The following code example illustrates how to insert a hyperlink field. + +A HYPERLINK field consists of five parts: [FieldBeginAdv](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.FieldBeginAdv.html), the field code text in a [SpanAdv](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.SpanAdv.html), [FieldSeparatorAdv](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.FieldSeparatorAdv.html), the field result text in another [SpanAdv](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.SpanAdv.html), and [FieldEndAdv](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.FieldEndAdv.html). + {% tabs %} {% highlight xaml %} @@ -70,7 +76,7 @@ paragraphAdv.Inlines.Add(New FieldEndAdv()) {% endhighlight %} {% endtabs %} -The following code example illustrates how to insert hyperlink field into SfRichTextBoxAdv Document through UI command. +The following code example illustrates how to insert hyperlink field into SfRichTextBoxAdv Document through the [InsertHyperlinkCommand](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_Windows_Controls_RichTextBoxAdv_SfRichTextBoxAdv_InsertHyperlinkCommand) UI command. The `CommandParameter` accepts a URL string that the hyperlink will point to. {% tabs %} {% highlight xaml %}