Has anyone been able to get TMSFMXRichEditor.Merge() to work in Delphi using the help on page 16-17 of the TMS FMX RichEditor Guide.

I created two tags <<Project>> <<Job>> in my text and tried to merge data into the text. I got just the job name 'FC04' to display sometimes but not in <<Job>>. Does anyone have a good example of merge code that worked.

   sl := Tstringlis.Create;




My problem may be how to create the Merge fields. I am just typing <<Project>> and <<Job>> in my text and saving it. PDF Help says something about the Merge fields displaying as brackets and a grey background. How do I get them created then?

When my editor reopens with my codes in the text, I click a button to do the fill but it doesn't work. If I put my cursor on one of the fields and click the button, it will replace it with the last item in SL list. it won't replace the fields as desired for the whole thing.

procedure TfrmFileEditor.btnFillClick(Sender: TObject);


sl: Tstringlist;

textstr: string;






   sl := TStringList.Create;








The method SetSelectionMergeField() applies a merge fieldname to the currently selected text in the TAdvRichEditor. It is in operation similar to SetSelectionColor() that applies a specific text color to the selected text.
So, to set merge fields, you first need to ensure there is text selected you want to use as merge field text. When you perform a merge, it is this selected text that will be replaced by the merge field value.

We ended up using TMSEditor2.ReplaceFirst('<H>', inttoStr(H)) instead of merge. Our goal is to auto renumber all sections in a document before output.