You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to perform mail merge using Telerik Document Processing Library, where HTML content needs to replace placeholders in a DOCX template. When performing mail merge, the library binds plain HTML text instead of rendering the HTML with formatting. In some cases, using the HtmlFormatProvider results in corrupted documents.
21
+
This article demonstrates a sample approach how to simulate [mail merge]({%slug radwordsprocessing-editing-mail-merge%}), where HTML content needs to replace placeholders in a DOCX template. When performing mail merge, the WordProcessing library binds plain HTML text instead of rendering the HTML with formatting.
22
22
23
-
This knowledge base article also answers the following questions:
24
-
- How to insert formatted HTML content in mail merge using Telerik Document Processing?
25
-
- How to replace placeholders with styled HTML content in RadFlowDocument?
26
-
- How to use HtmlFormatProvider correctly in Telerik WordsProcessing?
23
+

27
24
28
25
## Solution
29
26
30
-
To render HTML content during mail merge, use the find-and-replace functionality instead of the default mail merge engine. Replace placeholders with styled HTML content using the following steps:
27
+
To render HTML content during mail merge, use the [Find-and-Replace]({%slug radwordsprocessing-editing-find-and-replace%}) functionality instead of the default mail merge engine. Replace placeholders with styled HTML content using the following steps:
31
28
32
-
1. Import the HTML content using HtmlFormatProvider.
33
-
2. Import the DOCX template using DocxFormatProvider.
29
+
1. Import the HTML content using [HtmlFormatProvider]({%slug radwordsprocessing-formats-and-conversion-html-htmlformatprovider%}).
30
+
2. Import the DOCX template using [DocxFormatProvider]({%slug radwordsprocessing-formats-and-conversion-docx-docxformatprovider%}).
34
31
3. Find placeholders in the template and replace them with the imported HTML content.
-[Replace Text with Document Elements](https://docs.telerik.com/devtools/document-processing/libraries/radwordsprocessing/editing/find-and-replace/replace-document-elements)
*[RadFlowDocumentEditor API Reference](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Flow.Model.Editing.RadFlowDocumentEditor.html)
102
+
*[Simulating Mail Merge with HTML content by Utilizing the Find and Replace Functionality]({%slug simulating-mail-merge-with-html-content%})
Copy file name to clipboardExpand all lines: libraries/radwordsprocessing/editing/mail-merge.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -227,4 +227,5 @@ If you want to separate the items into several rows you need to close the group
227
227
*[Populate a Table with Data using Nested Mail Merge Functionality]({%slug populate-table-data-mail-merge%})
228
228
*[Generating a Word Document Template with Data Using MailMerge in RadWordsProcessing]({%slug generate-doc-template-and-populate-with-collection-data-mail-merge%})
229
229
*[How to Remove a MERGEFIELD While Replacing the Placeholders with Values in RadWordsProcessing]({%slug remove-mergefields-retain-values-radwordsprocessing%})
230
-
*[Performing Nested MailMerge with Multiple Levels in RadWordsProcessing]({%slug nested-mailmerge-radwordsprocessing%})
230
+
*[Performing Nested MailMerge with Multiple Levels in RadWordsProcessing]({%slug nested-mailmerge-radwordsprocessing%})
231
+
*[Simulating Mail Merge with HTML content by Utilizing the Find and Replace Functionality]({%slug simulating-mail-merge-with-html-content%})
0 commit comments