From 3307dcb67b3cbd57dcb050f2a54c56e51a75f48a Mon Sep 17 00:00:00 2001 From: Kalaivannan-Ganesan <93248069+Kalaivannan-Ganesan@users.noreply.github.com> Date: Wed, 22 Jul 2026 19:04:16 +0530 Subject: [PATCH 01/16] Addressed the document properties issues --- .../Word-Processor/wpf/Document-Properties.md | 50 ++++++++++--------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/Document-Processing/Word/Word-Processor/wpf/Document-Properties.md b/Document-Processing/Word/Word-Processor/wpf/Document-Properties.md index 27450ab11c..5cc06f071a 100644 --- a/Document-Processing/Word/Word-Processor/wpf/Document-Properties.md +++ b/Document-Processing/Word/Word-Processor/wpf/Document-Properties.md @@ -1,29 +1,29 @@ --- title: Document Properties in WPF RichTextBox control | Syncfusion -description: Learn here all about Document Properties support in Syncfusion WPF RichTextBox (SfRichTextBoxAdv) control and more. +description: Learn about the Document Properties support in Syncfusion WPF RichTextBox (SfRichTextBoxAdv) control and more. platform: document-processing control: SfRichTextBoxAdv documentation: ug keywords: Word count, paragraph count, page count, current page number. --- # Document Properties in WPF RichTextBox (SfRichTextBoxAdv) -[WPF RichTexBox](https://www.syncfusion.com/wpf-controls/richtextbox) keep tracking the statistics about your documents. These statistics contains information about word count, paragraph count and pages count. +[WPF RichTextBox](https://www.syncfusion.com/wpf-controls/richtextbox) keeps track of the statistics about your documents. These statistics contain information about word count, paragraph count and pages count. ## Word Count RichTextBox automatically counts the number of words in a document while you type. You can get the words count from [WordCount](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_Windows_Controls_RichTextBoxAdv_SfRichTextBoxAdv_WordCount.html) property. The default value of this property is 0. The following sample code demonstrates how to get the total number of words in the document. {% tabs %} -{% highlight Xaml %} - +{% highlight xaml %} + {% endhighlight %} -{% highlight C# %} -int wordCount.Text = richTextBoxAdv.WordCount.ToString(); +{% highlight c# %} +int wordCount = richTextBoxAdv.WordCount; {% endhighlight %} {% highlight VB %} -wordCount.Text = richTextBoxAdv.WordCount.ToString() +Dim wordCount As Integer = richTextBoxAdv.WordCount {% endhighlight %} {% endtabs %} @@ -33,66 +33,66 @@ RichTextBox automatically counts the number of paragraphs in a document while yo The following sample code demonstrates how to get the total number of paragraphs in the document. {% tabs %} -{% highlight Xaml %} - +{% highlight xaml %} + {% endhighlight %} -{% highlight C# %} -int paragraphCount.Text = richTextBoxAdv.ParagraphCount.ToString(); +{% highlight c# %} +int paragraphCount = richTextBoxAdv.ParagraphCount; {% endhighlight %} {% highlight VB %} -paragraphCount.Text = richTextBoxAdv.ParagraphCount.ToString() +Dim paragraphCount As Integer = richTextBoxAdv.ParagraphCount {% endhighlight %} {% endtabs %} ## Page Count -RichTextBox counts the number of pages in a document while you type. You can get the pages count from [PageCount](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_Windows_Controls_RichTextBoxAdv_SfRichTextBoxAdv_ParagraphCount.html) property. The default value of this property is 0. +RichTextBox counts the number of pages in a document while you type. You can get the page count from [PageCount](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_Windows_Controls_RichTextBoxAdv_SfRichTextBoxAdv_PageCount.html) property. The default value of this property is 0. The following sample code demonstrates how to get the total number of pages in the document. {% tabs %} -{% highlight Xaml %} +{% highlight xaml %} {% endhighlight %} -{% highlight C# %} +{% highlight c# %} private void RichTextBoxAdv_SelectionChanged(object obj, SelectionChangedEventArgs args) { - pageCount.Text = richTextBoxAdv.PageCount.ToString(); + PageCount.Text = richTextBoxAdv.PageCount.ToString(); } {% endhighlight %} {% highlight VB %} Private Sub RichTextBoxAdv_SelectionChanged(ByVal obj As Object, ByVal args As SelectionChangedEventArgs) -pageCount.Text = richTextBoxAdv.PageCount.ToString() +PageCount.Text = richTextBoxAdv.PageCount.ToString() End Sub {% endhighlight %} {% endtabs %} -## Current Page number +## Current Page Number The [CurrentPageNumber](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_Windows_Controls_RichTextBoxAdv_SfRichTextBoxAdv_CurrentPageNumber.html) property in the RichTextBox control returns the page number where the selection(cursor) is present. The following sample code demonstrates how to get current page number in the document. {% tabs %} -{% highlight Xaml %} +{% highlight xaml %} {% endhighlight %} -{% highlight C# %} +{% highlight c# %} private void RichTextBoxAdv_SelectionChanged(object obj, SelectionChangedEventArgs args) { - currentPageNumber.Text = richTextBoxAdv.CurrentPageNumber.ToString(); + CurrentPageNumber.Text = richTextBoxAdv.CurrentPageNumber.ToString(); } {% endhighlight %} {% highlight VB %} Private Sub RichTextBoxAdv_SelectionChanged(ByVal obj As Object, ByVal args As SelectionChangedEventArgs) - currentPageNumber.Text = richTextBoxAdv.CurrentPageNumber.ToString() + CurrentPageNumber.Text = richTextBoxAdv.CurrentPageNumber.ToString() End Sub {% endhighlight %} @@ -100,5 +100,9 @@ End Sub N> The above PageCount and CurrentPageNumber properties are not a dependency property. And it is not notifying for dynamic changes. So, get these properties value in selection changed event. -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. + +## See Also + +- [WPF RichTextBox Feature Tour](https://www.syncfusion.com/docx-editor-sdk/wpf-docx-editor) +- [WPF RichTextBox Examples](https://github.com/syncfusion/docx-editor-sdk-wpf-demos) From 2cb25a5e349d0078d871cd2bce14110a99bd6fbd Mon Sep 17 00:00:00 2001 From: Kalaivannan-Ganesan <93248069+Kalaivannan-Ganesan@users.noreply.github.com> Date: Wed, 22 Jul 2026 19:13:33 +0530 Subject: [PATCH 02/16] Updated the correct links --- .../Word/Word-Processor/wpf/Document-Properties.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Document-Processing/Word/Word-Processor/wpf/Document-Properties.md b/Document-Processing/Word/Word-Processor/wpf/Document-Properties.md index 5cc06f071a..6922fac9da 100644 --- a/Document-Processing/Word/Word-Processor/wpf/Document-Properties.md +++ b/Document-Processing/Word/Word-Processor/wpf/Document-Properties.md @@ -10,7 +10,7 @@ keywords: Word count, paragraph count, page count, current page number. [WPF RichTextBox](https://www.syncfusion.com/wpf-controls/richtextbox) keeps track of the statistics about your documents. These statistics contain information about word count, paragraph count and pages count. ## Word Count -RichTextBox automatically counts the number of words in a document while you type. You can get the words count from [WordCount](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_Windows_Controls_RichTextBoxAdv_SfRichTextBoxAdv_WordCount.html) property. The default value of this property is 0. +RichTextBox automatically counts the number of words in a document while you type. You can get the words count from [WordCount](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_Windows_Controls_RichTextBoxAdv_SfRichTextBoxAdv_WordCount) property. The default value of this property is 0. The following sample code demonstrates how to get the total number of words in the document. {% tabs %} @@ -29,7 +29,7 @@ Dim wordCount As Integer = richTextBoxAdv.WordCount {% endtabs %} ## Paragraph Count -RichTextBox automatically counts the number of paragraphs in a document while you type. You can get the paragraph count from [ParagraphCount](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_Windows_Controls_RichTextBoxAdv_SfRichTextBoxAdv_ParagraphCount.html) property. The default value of this property is 0. Also, it ignores empty paragraphs. +RichTextBox automatically counts the number of paragraphs in a document while you type. You can get the paragraph count from [ParagraphCount](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_Windows_Controls_RichTextBoxAdv_SfRichTextBoxAdv_ParagraphCount) property. The default value of this property is 0. Also, it ignores empty paragraphs. The following sample code demonstrates how to get the total number of paragraphs in the document. {% tabs %} @@ -48,7 +48,7 @@ Dim paragraphCount As Integer = richTextBoxAdv.ParagraphCount {% endtabs %} ## Page Count -RichTextBox counts the number of pages in a document while you type. You can get the page count from [PageCount](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_Windows_Controls_RichTextBoxAdv_SfRichTextBoxAdv_PageCount.html) property. The default value of this property is 0. +RichTextBox counts the number of pages in a document while you type. You can get the page count from [PageCount](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_Windows_Controls_RichTextBoxAdv_SfRichTextBoxAdv_PageCount) property. The default value of this property is 0. The following sample code demonstrates how to get the total number of pages in the document. {% tabs %} @@ -73,7 +73,7 @@ End Sub {% endtabs %} ## Current Page Number -The [CurrentPageNumber](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_Windows_Controls_RichTextBoxAdv_SfRichTextBoxAdv_CurrentPageNumber.html) property in the RichTextBox control returns the page number where the selection(cursor) is present. +The [CurrentPageNumber](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_Windows_Controls_RichTextBoxAdv_SfRichTextBoxAdv_CurrentPageNumber) property in the RichTextBox control returns the page number where the selection(cursor) is present. The following sample code demonstrates how to get current page number in the document. From 84870c58a273146076c1652cf4a7118ef2f04735 Mon Sep 17 00:00:00 2001 From: Kalaivannan-Ganesan <93248069+Kalaivannan-Ganesan@users.noreply.github.com> Date: Wed, 22 Jul 2026 19:32:01 +0530 Subject: [PATCH 03/16] Resolved the document structure errors --- .../Word/Word-Processor/wpf/Document-Structure.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Document-Processing/Word/Word-Processor/wpf/Document-Structure.md b/Document-Processing/Word/Word-Processor/wpf/Document-Structure.md index 7e21603d92..b1f00a662c 100644 --- a/Document-Processing/Word/Word-Processor/wpf/Document-Structure.md +++ b/Document-Processing/Word/Word-Processor/wpf/Document-Structure.md @@ -1,6 +1,6 @@ --- title: Document Structure in WPF RichTextBox control | Syncfusion -description: Learn here all about Document Structure support in Syncfusion WPF RichTextBox (SfRichTextBoxAdv) control and more. +description: Learn about the Document Structure support in Syncfusion WPF RichTextBox (SfRichTextBoxAdv) control and more. platform: document-processing control: SfRichTextBoxAdv documentation: ug @@ -10,4 +10,7 @@ keywords: document-structure ![Document Structure of WPF RichTextBox](Document-Structure_images/wpf-richtextbox-document-structure.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 knows how to render and configure the editing tools. \ No newline at end of file +## See Also + +- [WPF RichTextBox Feature Tour](https://www.syncfusion.com/docx-editor-sdk/wpf-docx-editor) +- [WPF RichTextBox Examples](https://github.com/syncfusion/docx-editor-sdk-wpf-demos) \ No newline at end of file From a10a1e61ebec2a2f5a682b64a425432d2974b9bf Mon Sep 17 00:00:00 2001 From: Kalaivannan-Ganesan <93248069+Kalaivannan-Ganesan@users.noreply.github.com> Date: Wed, 22 Jul 2026 20:18:52 +0530 Subject: [PATCH 04/16] Addressed error logs of document styles --- .../Word-Processor/wpf/Document-Styles.md | 39 +++++++++---------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/Document-Processing/Word/Word-Processor/wpf/Document-Styles.md b/Document-Processing/Word/Word-Processor/wpf/Document-Styles.md index 0f6461eba0..31e91686f6 100644 --- a/Document-Processing/Word/Word-Processor/wpf/Document-Styles.md +++ b/Document-Processing/Word/Word-Processor/wpf/Document-Styles.md @@ -1,6 +1,6 @@ --- title: Document Styles in WPF RichTextBox control | Syncfusion -description: Learn here all about Document Styles support in Syncfusion WPF RichTextBox (SfRichTextBoxAdv) control and more. +description: Learn about the Document Styles support in Syncfusion WPF RichTextBox (SfRichTextBoxAdv) control and more. platform: document-processing control: SfRichTextBoxAdv documentation: ug @@ -13,26 +13,20 @@ A style is a predefined set of table, numbering, paragraph, and character format In [WPF RichTextBox](https://www.syncfusion.com/docx-editor-sdk/wpf-docx-editor), styles are created and added to a document programmatically or using the built-in Styles dialog. A style in a document should have the following properties: -### Name -Name of the style. All styles in a document have a unique name, which is used as an identifier when applying the style. -### Type -Specifies the document elements that the style will target. For example, paragraph or character. +**Name** – Name of the style. All styles in a document have a unique name, which is used as an identifier when applying the style. -### Next -Specifies the style that will be automatically applied to a new paragraph, which is created following a paragraph with the parent paragraph style applied. +**Type** – Specifies the document elements that the style will target. For example, paragraph or character. -### Link -Provides a relation between the paragraph and character style. +**Next** – Specifies the style that will be automatically applied to a new paragraph, which is created following a paragraph with the parent paragraph style applied. -### CharacterFormat -Specifies the properties of paragraph and character style. +**Link** – Provides a relation between the paragraph and character style. -### ParagraphFormat -Specifies the properties of paragraph style. +**CharacterFormat** – Specifies the properties of paragraph and character style. -### BasedOn -Specifies that the current style inherits the style set to this property. This is how hierarchical styles are defined. It can be optional. +**ParagraphFormat** – Specifies the properties of paragraph style. + +**BasedOn** – Specifies that the current style inherits the style set to this property. This is how hierarchical styles are defined. It can be optional. N> The style type should match the inherited style type. For example, it is not possible to have a character style inherit a paragraph style. @@ -81,13 +75,13 @@ SfRichTextBoxAdv provides the following functionalities related with styles: * Apply style * Clear formatting -## Create new style +## Create New Style New styles are created and added to the style collection of the document. Here, you can create character, paragraph and linked type styles. The following code example explains how to create new style dialog through command binding. {% tabs %} {% highlight xaml %} - + {% endhighlight %} {% endtabs %} @@ -99,7 +93,7 @@ You can modify a style directly using the ShowStylesDialogCommand in SfRichTextB The following code example explains how to modify the style dialog through command binding. {% tabs %} {% highlight xaml %} - + {% endhighlight %} {% endtabs %} @@ -119,7 +113,7 @@ When there is no selection, styles of Linked type will change the values of the The following code example explains how to apply style through command binding. {% tabs %} {% highlight xaml %} - + {% endhighlight %} {% endtabs %} @@ -129,8 +123,11 @@ It will remove all the formatting from the selection leaving only the normal unf The following code example explains how to clear the formatting of text through command binding. {% tabs %} {% highlight xaml %} - + {% endhighlight %} {% endtabs %} -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. +## See Also + +- [WPF RichTextBox Feature Tour](https://www.syncfusion.com/docx-editor-sdk/wpf-docx-editor) +- [WPF RichTextBox Examples](https://github.com/syncfusion/docx-editor-sdk-wpf-demos) \ No newline at end of file From 19b81e9f2f2d74014f899ddda3be4c241031cc91 Mon Sep 17 00:00:00 2001 From: Kalaivannan-Ganesan <93248069+Kalaivannan-Ganesan@users.noreply.github.com> Date: Thu, 23 Jul 2026 07:14:09 +0530 Subject: [PATCH 05/16] Addressed the FAQ feedbacks --- ...edded-image-in-HTML-in-SfRichTextBoxAdv.md | 11 +++++++--- ...d-to-the-bottom-of-the-SfRichTextBoxAdv.md | 21 ++++++++++++------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/Document-Processing/Word/Word-Processor/wpf/FAQ-Section/How-to-export-the-inserted-image-as-an-Embedded-image-in-HTML-in-SfRichTextBoxAdv.md b/Document-Processing/Word/Word-Processor/wpf/FAQ-Section/How-to-export-the-inserted-image-as-an-Embedded-image-in-HTML-in-SfRichTextBoxAdv.md index 70480525ae..ea4d5e24ec 100644 --- a/Document-Processing/Word/Word-Processor/wpf/FAQ-Section/How-to-export-the-inserted-image-as-an-Embedded-image-in-HTML-in-SfRichTextBoxAdv.md +++ b/Document-Processing/Word/Word-Processor/wpf/FAQ-Section/How-to-export-the-inserted-image-as-an-Embedded-image-in-HTML-in-SfRichTextBoxAdv.md @@ -1,6 +1,6 @@ --- title: Export image as Embedded in HTML in WPF SfRichTextBoxAdv | Syncfusion -description: Learn here all about how to export the inserted image as an Embedded image in HTML in Syncfusion WPF SfRichTextBoxAdv and more. +description: Learn how to export the inserted image as an embedded image in HTML in Syncfusion WPF SfRichTextBoxAdv and more. platform: document-processing control: SfRichTextBoxAdv documentation: ug @@ -11,7 +11,7 @@ keywords: embedded-image-html This page explains how to export the inserted image as an Embedded image in HTML in [WPF RichTextBox](https://www.syncfusion.com/docx-editor-sdk/wpf-docx-editor) (SfRichTextBoxAdv). -In the SfRichTextBoxAdv control, we offer an option to specify HTML export settings. By utilizing the [ImageNodeVisitedEvent](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.ImageNodeVisitedEventArgs.html) event of the [HtmlImportExportSettings](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.HtmlImportExportSettings.html) instance, you can both retrieve and define the image stream and image source. When setting the image source as Empty, the inserted picture can be exported as an embedded image in the HTML. +In the SfRichTextBoxAdv control, the control provides an option to specify HTML export settings. By utilizing the [ImageNodeVisited](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.ImageNodeVisitedEventArgs.html) event of the [HtmlImportExportSettings](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.HtmlImportExportSettings.html) instance, you can both retrieve and define the image stream and image source. When setting the image source as Empty, the inserted picture can be exported as an embedded image in the HTML. The following code example illustrates to export the inserted image as an Embedded image in HTML in the SfRichTextBoxAdv. @@ -36,4 +36,9 @@ richTextBoxAdv.HtmlImportExportSettings.ImageNodeVisited += HtmlImportExportSett // Unhooks the event handler for ImageNodeVisited event. richTextBoxAdv.HtmlImportExportSettings.ImageNodeVisited -= HtmlImportExportSettings_ImageNodeVisited; {% endhighlight %} -{% endtabs %} \ No newline at end of file +{% endtabs %} + +## See Also + +- [WPF RichTextBox Feature Tour](https://www.syncfusion.com/docx-editor-sdk/wpf-docx-editor) +- [WPF RichTextBox Examples](https://github.com/syncfusion/docx-editor-sdk-wpf-demos) \ No newline at end of file diff --git a/Document-Processing/Word/Word-Processor/wpf/FAQ-Section/How-to-identify-whether-the-viewer-is-scrolled-to-the-bottom-of-the-SfRichTextBoxAdv.md b/Document-Processing/Word/Word-Processor/wpf/FAQ-Section/How-to-identify-whether-the-viewer-is-scrolled-to-the-bottom-of-the-SfRichTextBoxAdv.md index a5e2dba2fa..45144cb251 100644 --- a/Document-Processing/Word/Word-Processor/wpf/FAQ-Section/How-to-identify-whether-the-viewer-is-scrolled-to-the-bottom-of-the-SfRichTextBoxAdv.md +++ b/Document-Processing/Word/Word-Processor/wpf/FAQ-Section/How-to-identify-whether-the-viewer-is-scrolled-to-the-bottom-of-the-SfRichTextBoxAdv.md @@ -1,19 +1,19 @@ --- -title: Detect viewer scrolled to bottom in WPF SfRichTextBoxAdv | Syncfusion -description: Learn here all about how to identify whether the viewer is scrolled to the bottom in Syncfusion WPF SfRichTextBoxAdv and more. +title: Detect When the Viewer is Scrolled to the Bottom in WPF SfRichTextBoxAdv | Syncfusion +description: Learn how to identify whether the viewer is scrolled to the bottom in Syncfusion WPF SfRichTextBoxAdv and more. platform: document-processing control: SfRichTextBoxAdv documentation: ug keywords: scroll-to-bottom --- -# Detect viewer scrolled to bottom in WPF SfRichTextBoxAdv +# Detect When the Viewer is Scrolled to the Bottom in WPF SfRichTextBoxAdv This page explains how to identify whether the viewer is scrolled to the bottom in [WPF RichTextBox](https://www.syncfusion.com/docx-editor-sdk/wpf-docx-editor) (SfRichTextBoxAdv). -SfRichTextBoxAdv scrollbars can be accessed through the [VerticalScrollBar](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_Windows_Controls_RichTextBoxAdv_SfRichTextBoxAdv_VerticalScrollBar) and [HorizontalScrollBar](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_Windows_Controls_RichTextBoxAdv_SfRichTextBoxAdv_HorizontalScrollBar) properties of [SfRichTextBoxAdv](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.SfRichTextBoxAdv.html) class. Using these properties, we can identify when the document is scrolled to the bottom of the control. +SfRichTextBoxAdv scrollbars can be accessed through the [VerticalScrollBar](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_Windows_Controls_RichTextBoxAdv_SfRichTextBoxAdv_VerticalScrollBar) and [HorizontalScrollBar](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_Windows_Controls_RichTextBoxAdv_SfRichTextBoxAdv_HorizontalScrollBar) properties of [SfRichTextBoxAdv](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.SfRichTextBoxAdv.html) class. Using these properties, you can identify when the document is scrolled to the bottom of the control. -We can use the ValueChanged event of the [VerticalScrollBar](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_Windows_Controls_RichTextBoxAdv_SfRichTextBoxAdv_VerticalScrollBar) for this purpose. Check if the scroll bar's value equals the [VerticalScrollBar](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_Windows_Controls_RichTextBoxAdv_SfRichTextBoxAdv_VerticalScrollBar) Maximum property value, if these values are equal then the vertical scroll bar has been scrolled to the bottom of the control. +You can use the ValueChanged event of the [VerticalScrollBar](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_Windows_Controls_RichTextBoxAdv_SfRichTextBoxAdv_VerticalScrollBar) for this purpose. Check if the scroll bar's value equals the VerticalScrollBar Maximum property value. If these values are equal, then the vertical scroll bar has been scrolled to the bottom of the control. The following code example illustrates to identify whether the viewer is scrolled to the bottom of the SfRichTextBoxAdv. @@ -41,9 +41,14 @@ The following code example illustrates to identify whether the viewer is scrolle { if (e.NewValue == richTextBoxAdv.VerticalScrollBar.Maximum) { - ///When the scroll bar value and its maximum value are same. - ///Then scroll reached the bottom of the control. + //When the scroll bar value and its maximum value are same. + //Then scroll reached the bottom of the control. } } {% endhighlight %} -{% endtabs %} \ No newline at end of file +{% endtabs %} + +## See Also + +- [WPF RichTextBox Feature Tour](https://www.syncfusion.com/docx-editor-sdk/wpf-docx-editor) +- [WPF RichTextBox Examples](https://github.com/syncfusion/docx-editor-sdk-wpf-demos) \ No newline at end of file From bdc8df693e1eb12cd0046c8a6fc2e6c8ef19dc35 Mon Sep 17 00:00:00 2001 From: Kalaivannan-Ganesan <93248069+Kalaivannan-Ganesan@users.noreply.github.com> Date: Thu, 23 Jul 2026 08:04:56 +0530 Subject: [PATCH 06/16] Addressed the error logs --- ...Document-from-DocIO-in-SfRichTextBoxAdv.md | 55 +++++++++++-------- ...ichTextBoxAdv-as-a-standard-RichTextBox.md | 11 +++- 2 files changed, 40 insertions(+), 26 deletions(-) diff --git a/Document-Processing/Word/Word-Processor/wpf/FAQ-Section/How-to-paste-WordDocument-from-DocIO-in-SfRichTextBoxAdv.md b/Document-Processing/Word/Word-Processor/wpf/FAQ-Section/How-to-paste-WordDocument-from-DocIO-in-SfRichTextBoxAdv.md index d8a15ef17f..e6d2279fa1 100644 --- a/Document-Processing/Word/Word-Processor/wpf/FAQ-Section/How-to-paste-WordDocument-from-DocIO-in-SfRichTextBoxAdv.md +++ b/Document-Processing/Word/Word-Processor/wpf/FAQ-Section/How-to-paste-WordDocument-from-DocIO-in-SfRichTextBoxAdv.md @@ -1,79 +1,88 @@ --- title: How to paste WordDocument from DocIO in the WPF SfRichTextBoxAdv. | Syncfusion -description: Learn here all about how to paste WordDocument from .NET Word library (DocIO) in Syncfusion WPF SfRichTextBoxAdv and more. +description: Learn how to paste a Word document from .NET Word library (DocIO) in Syncfusion WPF SfRichTextBoxAdv and more. platform: document-processing control: SfRichTextBoxAdv documentation: ug keywords: paste-WordDocument-from-DocIO --- -# Paste WordDocument from .NET Word library (DocIO) in the WPF SfRichTextBoxAdv +# Paste a Word Document from .NET Word Library (DocIO) into WPF SfRichTextBoxAdv -The PasteCommand with [WordDocument](https://help.syncfusion.com/cr/file-formats/Syncfusion.DocIO.DLS.WordDocument.html) as a parameter is a feature that allows you to paste the contents of a WordDocument into the current selection of the SfRichTextBoxAdv control.This provides a convenient and efficient way to transfer and display complex document structures from Word documents directly within the SfRichTextBoxAdv. +The PasteCommand with [WordDocument](https://help.syncfusion.com/cr/file-formats/Syncfusion.DocIO.DLS.WordDocument.html) as a parameter is a feature that allows you to paste the contents of a WordDocument into the current selection of the SfRichTextBoxAdv control. This provides a convenient and efficient way to transfer and display complex document structures from Word documents directly within the SfRichTextBoxAdv. -Using this feature, you can achieve below things by pasting WordDocument into the [WPF RichTextBox](https://www.syncfusion.com/docx-editor-sdk/wpf-docx-editor) (SfRichTextBoxAdv) at current selection: +Using this feature, you can achieve the following by pasting WordDocument into the [WPF RichTextBox](https://www.syncfusion.com/docx-editor-sdk/wpf-docx-editor) (SfRichTextBoxAdv) at current selection: * Perform all the document manipulation features of [.NET Word library (DocIO)](https://help.syncfusion.com/file-formats/docio/overview) and then finally insert into SfRichTextBoxAdv -* Insert another [Word document](https://help.syncfusion.com/file-formats/docio/word-file-formats) (DOC, DOCX) and [HTML](https://help.syncfusion.com/file-formats/docio/html) document from DocIO. +* Insert another [Word document](https://help.syncfusion.com/file-formats/docio/word-file-formats) (DOC, DOCX) and an [HTML](https://help.syncfusion.com/file-formats/docio/html) document from DocIO. * Insert part of another Word document by retrieving the part of content using [bookmark functionality](https://help.syncfusion.com/file-formats/docio/working-with-bookmarks) in DocIO. -* Create new elements in scratch as per desired formatting such as [text](https://help.syncfusion.com/file-formats/docio/working-with-paragraph#working-with-text), [images](https://help.syncfusion.com/file-formats/docio/working-with-paragraph#working-with-images), [tables](https://help.syncfusion.com/file-formats/docio/working-with-tables) and more using DocIO and paste that WordDocument instance. +* Create new elements from scratch as per desired formatting such as [text](https://help.syncfusion.com/file-formats/docio/working-with-paragraph#working-with-text), [images](https://help.syncfusion.com/file-formats/docio/working-with-paragraph#working-with-images), [tables](https://help.syncfusion.com/file-formats/docio/working-with-tables) and more using DocIO and paste that WordDocument instance. -The following code example illustrates how to design a table with set of formatting using DocIO and paste it into the SfRichTextBoxAdv using WordDocument. +The following code example illustrates how to design a table with a set of formatting using DocIO and paste it into the SfRichTextBoxAdv using WordDocument. {% tabs %} {% highlight c# %} -///Paste the WordDocument into SfRichTextBoxAdv. +//Paste the WordDocument into SfRichTextBoxAdv. WordDocument document = CreateTable(); -SfRichTextBoxAdv.PasteCommand.Execute(document,richTextBoxAdv); +SfRichTextBoxAdv.PasteCommand.Execute(document, richTextBoxAdv); /// /// The following helper method illustrates how to create table in DocIO. /// -Private WordDocument CreateTable() +private WordDocument CreateTable() { -///Creates an instance of WordDocument class +//Creates an instance of WordDocument class WordDocument document = new WordDocument(); -///Adds a section into Word document +//Adds a section into Word document IWSection section = document.AddSection(); -///Adds a new table into Word document +//Adds a new table into Word document IWTable table = section.AddTable(); -///Specifies the total number of rows & columns +//Specifies the total number of rows & columns table.ResetCells(10, 6); -///Iterates the rows of the table +//Iterates the rows of the table for (int i = 0; i < table.Rows.Count; i++) { WTableRow wTableRow = table.Rows[i]; - ///Iterates through the cells of rows + //Iterates through the cells of rows for (int j = 0; j < wTableRow.Cells.Count; j++) { WTableCell wTableCell = wTableRow.Cells[j]; - ///Specifies the left, right, top and bottom padding of the cell. + //Specifies the left, right, top and bottom padding of the cell. wTableCell.CellFormat.Paddings.Left = 7.5f; wTableCell.CellFormat.Paddings.Top = 7.5f; wTableCell.CellFormat.Paddings.Right = 7.5f; wTableCell.CellFormat.Paddings.Bottom = 7.5f; - ///set background color for cell. + //set background color for cell. wTableCell.CellFormat.BackColor = Color.Blue; - ///Set border type for tablecell borders + //Set border type for tablecell borders wTableCell.CellFormat.Borders.BorderType = BorderStyle.Single; - ///Set color for tablecell borders + //Set color for tablecell borders wTableCell.CellFormat.Borders.Color = Color.Red; wTableCell.CellFormat.Borders.Top.Color = Color.Red; wTableCell.CellFormat.Borders.Bottom.Color = Color.Red; wTableCell.CellFormat.Borders.Right.Color = Color.Red; wTableCell.CellFormat.Borders.Left.Color = Color.Red; - ///Set line width for tablecell borders. + //Set line width for tablecell borders. wTableCell.CellFormat.Borders.LineWidth = 7.5f; } } - return WordDocument + return document; } {% endhighlight %} {% endtabs %} ## Limitation -When the document content is pasted into the SfRichTextBoxAdv control using WordDocument as a parameter, the history will not be maintained. That is, if a table is created using WordDocument, with multiple formats applied, and then table is pasted into the SfRichTextBoxAdv control, performing Undo will remove the inserted table, and performing Redo will insert the table again. Since, we are creating table outside of SfRichTextBoxAdv and it will not maintain history. \ No newline at end of file +When the document content is pasted into the SfRichTextBoxAdv control using WordDocument as a parameter, the history will not be maintained. For example, if a table is created using WordDocument with multiple formats applied and then pasted into the SfRichTextBoxAdv control, performing Undo will remove the inserted table. Performing Redo will insert the table again. Since we are creating the table outside of SfRichTextBoxAdv, it will not maintain history. + +N> This feature is supported from v22.2.5. + +## See Also + +- [PasteCommand API Reference](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_Windows_Controls_RichTextBoxAdv_SfRichTextBoxAdv_PasteCommand) +- [.NET Word Library (DocIO) Documentation](https://help.syncfusion.com/file-formats/docio/overview) +- [WPF RichTextBox Feature Tour](https://www.syncfusion.com/docx-editor-sdk/wpf-docx-editor) +- [WPF RichTextBox Examples](https://github.com/syncfusion/docx-editor-sdk-wpf-demos) diff --git a/Document-Processing/Word/Word-Processor/wpf/FAQ-Section/How-to-use-SfRichTextBoxAdv-as-a-standard-RichTextBox.md b/Document-Processing/Word/Word-Processor/wpf/FAQ-Section/How-to-use-SfRichTextBoxAdv-as-a-standard-RichTextBox.md index a077ac60d1..1178cc9b2d 100644 --- a/Document-Processing/Word/Word-Processor/wpf/FAQ-Section/How-to-use-SfRichTextBoxAdv-as-a-standard-RichTextBox.md +++ b/Document-Processing/Word/Word-Processor/wpf/FAQ-Section/How-to-use-SfRichTextBoxAdv-as-a-standard-RichTextBox.md @@ -1,5 +1,5 @@ --- -title: How to use SfRichTextBoxAdv as a standard RichTextBox. | Syncfusion +title: How to use SfRichTextBoxAdv as a standard RichTextBox | Syncfusion description: Learn how to use WPF SfRichTextBoxAdv as a standard RichTextBox along with its core key features and usage. platform: document-processing control: SfRichTextBoxAdv @@ -7,7 +7,7 @@ documentation: ug keywords: use-sfrichtextboxadv-like-richtextbox --- -# Use SfRichTextBoxAdv as a standard RichTextBox +# Use SfRichTextBoxAdv as a Standard RichTextBox Use the following code to configure the SfRichTextBoxAdv control as a standard RichTextBox with rich text formatting options. @@ -112,4 +112,9 @@ Use the following code to configure the SfRichTextBoxAdv control as a standard R When the application is executed, the standard RichTextBox control is displayed as illustrated below. ![WPF Standard RichTextBox](../Getting-Started_images/wpf-standard-sfrichtextboxadv.png) -N> [View Sample in GitHub](https://github.com/SyncfusionExamples/WPF-RichTextBox-Examples/tree/main/Samples/Standard%20RichTextBox). \ No newline at end of file +N> [View Sample in GitHub](https://github.com/SyncfusionExamples/WPF-RichTextBox-Examples/tree/main/Samples/Standard%20RichTextBox). + +## See Also + +- [WPF RichTextBox Feature Tour](https://www.syncfusion.com/docx-editor-sdk/wpf-docx-editor) +- [WPF RichTextBox Examples](https://github.com/syncfusion/docx-editor-sdk-wpf-demos) \ No newline at end of file From 23d8b9bcd984324575515db5af88136d81b33c2e Mon Sep 17 00:00:00 2001 From: Kalaivannan-Ganesan <93248069+Kalaivannan-Ganesan@users.noreply.github.com> Date: Fri, 24 Jul 2026 01:38:29 +0530 Subject: [PATCH 07/16] Addressed the error logs --- ...arge-size-documents-in-SfRichTextBoxAdv.md | 37 ++++-- .../Word-Processor/wpf/Find-and-Replace.md | 80 ++++++++---- .../Word/Word-Processor/wpf/Hyperlink.md | 45 +++++-- .../Word/Word-Processor/wpf/Image.md | 45 +++++-- .../Word-Processor/wpf/Import-and-Export.md | 105 ++++++++++------ .../Word/Word-Processor/wpf/Layout-Types.md | 45 ++++--- .../Word/Word-Processor/wpf/List.md | 114 +++++++++++------- .../Word/Word-Processor/wpf/Localization.md | 52 +++++--- .../Word/Word-Processor/wpf/Mini-Toolbar.md | 22 ++-- 9 files changed, 372 insertions(+), 173 deletions(-) diff --git a/Document-Processing/Word/Word-Processor/wpf/FAQ-Section/Why-does-out-of-memory-exception-throw-on-opening-large-size-documents-in-SfRichTextBoxAdv.md b/Document-Processing/Word/Word-Processor/wpf/FAQ-Section/Why-does-out-of-memory-exception-throw-on-opening-large-size-documents-in-SfRichTextBoxAdv.md index 54a09153a7..8c837941ec 100644 --- a/Document-Processing/Word/Word-Processor/wpf/FAQ-Section/Why-does-out-of-memory-exception-throw-on-opening-large-size-documents-in-SfRichTextBoxAdv.md +++ b/Document-Processing/Word/Word-Processor/wpf/FAQ-Section/Why-does-out-of-memory-exception-throw-on-opening-large-size-documents-in-SfRichTextBoxAdv.md @@ -1,17 +1,40 @@ --- -title: Opening large size documents in WPF SfRichTextBoxAdv | Syncfusion -description: Understand why out of memory exceptions occur in Syncfusion WPF SfRichTextBoxAdv when opening large documents and how to resolve them. +title: Out of memory exception in WPF SfRichTextBoxAdv | Syncfusion +description: Learn why an OutOfMemoryException occurs when opening large documents in the WPF SfRichTextBoxAdv control and the recommended workarounds to avoid it. platform: document-processing control: SfRichTextBoxAdv documentation: ug keywords: out-of-memory-exception --- -# Opening large size documents in WPF SfRichTextBoxAdv control +# Why does an out of memory exception occur in WPF SfRichTextBoxAdv? -This page explains Why does out of memory exception throw on opening large size documents in [WPF RichTextBox](https://www.syncfusion.com/docx-editor-sdk/wpf-docx-editor) (SfRichTextBoxAdv) control and more details. +This page explains why an `OutOfMemoryException` is thrown when opening large documents in the [WPF RichTextBox](https://www.syncfusion.com/docx-editor-sdk/wpf-docx-editor) (SfRichTextBoxAdv) control and provides guidance on how to avoid it. -## Why does out of memory exception throw on opening large size documents in WPF RichTextBox (SfRichTextBoxAdv) +## Cause -The SfRichTextBoxAdv control keeps the entire rich text content (text, images, tables, and all the other supported elements along with its formatting) of the document and its corresponding information needed for rendering in main memory. In case of opening a DOCX file, you may think that the file size is small and SfRichTextBoxAdv utilizes a very large memory; whereas it is a zip archive file with extension “docx” and SfRichTextBoxAdv control internally decompresses it and populates the content in the document object model by utilizing remarkable amount of main memory. -The SfRichTextBoxAdv control supports UI Virtualization. UI elements are created only for the contents that are visible in the viewer. The UI elements are created for the contents that become visible while scrolling the viewer. This reduces the main memory utilization and also improves UI performance. Even though UI Virtualization is handled, the main memory utilization increases with respect to the increase of content and its complexity. The main memory utilized by an instance will not be released until the instance is removed from the document. So, there is a chance for out of memory exception when the memory utilization exceeds the maximum level as the content of the document increases. In that case, split the contents to several documents or use high configuration machines with extended RAM so as to create or open large size documents comfortably. +The SfRichTextBoxAdv control keeps the entire rich text content of the document in memory. This includes the text, images, tables, and all other supported elements along with their formatting, as well as the information required for rendering. + +When opening a DOCX file, you may notice that the file size on disk is small, yet the SfRichTextBoxAdv uses a large amount of memory. This is because a DOCX file is a zip archive with the `.docx` extension, and the SfRichTextBoxAdv control internally decompresses it and populates the content in the document object model by using a significant amount of memory. + +## Impact + +The SfRichTextBoxAdv control supports UI Virtualization. UI elements are created only for the content that is visible in the viewer, and additional UI elements are created for the content that becomes visible while scrolling. This reduces memory usage and also improves UI performance. + +However, even with UI Virtualization in place, memory utilization increases with the size and complexity of the content. The memory used by a document instance will not be released until the document instance is removed. When memory utilization exceeds the maximum allowed level as the document content grows, an `OutOfMemoryException` can be thrown. + +## Resolution + +To avoid an `OutOfMemoryException` when working with large documents, consider the following workarounds: + +- **Split large documents** — Break the content into several smaller documents and open them individually instead of loading the entire document at once. +- **Use a high-configuration machine** — Run the application on a machine with sufficient RAM and CPU resources to comfortably load and edit the document. +- **Release document instances** — Dispose of document instances as soon as they are no longer needed so that the memory they occupy is released promptly. See [Memory cleanup](#memory-cleanup) for details. + +### Memory cleanup + +Memory used by a document instance is held until that instance is unloaded. To reclaim memory programmatically, do the following when a document is no longer needed: + +- Detach the document from the `SfRichTextBoxAdv` by setting the [Document](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.RichTextBoxAdv.SfRichTextBoxAdv.html#Syncfusion_Windows_Controls_RichTextBoxAdv_SfRichTextBoxAdv_Document) property to `null` or by clearing the underlying `DocumentStream`. +- If your application owns the `Stream` or `WordDocument` instance used to load the content, dispose of it as well. +- For long-running scenarios that load several documents, close each `SfRichTextBoxAdv` window or unload the control's content before opening the next document so that the previous document instance is eligible for garbage collection. 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..e2296a4b2b 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 + For j As Integer = 0 To textSearchResults.Count - 1 + Dim textSearchResult As TextSearchResult = textSearchResults(j) - 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.TextSearchResult.html) 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) 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,8 @@ 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 +171,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..43d6d00bad 100644 --- a/Document-Processing/Word/Word-Processor/wpf/Hyperlink.md +++ b/Document-Processing/Word/Word-Processor/wpf/Hyperlink.md @@ -4,12 +4,17 @@ 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). The field code text typically follows the syntax `HYPERLINK ""`. {% tabs %} {% highlight xaml %} @@ -53,7 +58,7 @@ paragraphAdv.Inlines.Add(New FieldBeginAdv()) ' Appends the field code. Dim fieldCode As New SpanAdv() Dim url As String = "www.syncfusion.com" -fieldCode.Text = (Convert.ToString(" HYPERLINK """) & url) + """ " +fieldCode.Text = " HYPERLINK """ & url & """ " paragraphAdv.Inlines.Add(fieldCode) ' Appends the field separator paragraphAdv.Inlines.Add(New FieldSeparatorAdv()) @@ -70,7 +75,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 %}