Scan content and insert Merge fields

2 posts, 0 answers
  1. Clifford
    Clifford avatar
    25 posts
    Member since:
    Sep 2013

    Posted 30 Oct 2013 Link to this post

    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.
  2. Boby
    Admin
    Boby avatar
    595 posts

    Posted 04 Nov 2013 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top