This is a migrated thread and some comments may be shown as answers.

Scan content and insert Merge fields

1 Answer 22 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Clifford
Top achievements
Rank 1
Clifford asked on 30 Oct 2013, 09:37 PM
I have a rich text document which I have gone through and put "<<" and ">>" around keywords that I want to have a Mail Merge fields. I have tired to put in the merge fields in the XAML, but does not work well. What is the best way to programatically search through the text of a RadDocument and replace some text with MailMerge fields.

1 Answer, 1 is accepted

Sort by
0
Boby
Telerik team
answered on 04 Nov 2013, 09:26 AM
Hi Clifford,
For searching/replacing content in the document, you can use DocumentTextSearch class and its FindAll method, as described in this help article. Note that the parameter of FindAll method is a regex. After fingind the necessary text ranges, you can replace them using RadDocumentEditor's (or RadRichTextBox's) method InsertField with appropriate MergeField as argument, as described here.

Regards,
Boby
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
RichTextBox
Asked by
Clifford
Top achievements
Rank 1
Answers by
Boby
Telerik team
Share this question
or