TWPMMInsertTextContents RTF Escape

  • HI,

    How can I insert RTF codes escape directly in the merge ?

    I would replace character * with the respective RTF code escape;

    Code
    procedure TmergeXml.MailMergeGetText(Sender: TObject;
      const inspname: String; Contents: TWPMMInsertTextContents);
      begin
            contents.StringValue:=StringReplace(fv.value,'*','\''2A',[rfReplaceAll]);
      end;

    Thank you

    • Offizieller Beitrag

    Sorry, I do not understand the question.

    If you have RTF code you can assign it to StringValue but you have to set the mergeasRTF flag in Contents.Options.

    If you want to replace text in the field, you can read Contents.OldText and OldFomattedText, work with it and assign it then to StringValue.