Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

RTF and MailMerge

edited May 2004 in General
I have a situation where I want to be able to put RTF codes into a field
that will then be used as a mail merge field in a report.

When I do something similar to this:

FieldByName('stringfield').AsString := '\b Bold Portion:\b0' + #9 +
'Unbolded portion';

the MailMerge field when the report is run gets displayed as:

\b Bold Portion:\b0 Unbolded portion



Is there a way I can get the RTF control to render the RTF after the merge
fields have been merged so I can get output as follows:

*Bold Portion:* Unbolded portion

where the part between the *'s is bold text?

Comments

  • edited May 2004
    By the way I am using Delphi 7 and Report Builder Professional 7.02 with
    Infopower 4000.0.4 wwRichEdit embedded as the RichText component in the
    RBuilder report designer.


  • edited May 2004
    *bump* Any help for this?


  • edited May 2004
    Hi Mike,

    Sorry, for some reason my news reader missed your original message. At
    run-time you can programmatically edit and manipulate the formatted text by
    using the Paragraph, SelAttributes, SelStart, SelLength, and SelText
    properties and the ClearSelection, FindText, and SelectAll methods. These
    are the same properties and methods associated with Delphi's TRichEdit
    control. You will want to use these properties to change the format of the
    richtext rather than directly inserting the tags into the plain text.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.