merging document with image embedded breaks document

  • This is from the final message in another thread & may have been overlooked...

    I have saved a merge template with an embedded image. When the merge executes, the image does not display and all text that follows the image is not visible.

    Here's my merge routine. Replacement vars are surrounded by [], and I have an OnMergeGetText handler.

    ActiveLetter.templateText is a string which holds the merge template rtf.


    Code
    procedure TfrmDeficiencyLetters.refreshEditor; 
    var 
    n: integer; 
    begin 
    rtfEditor.AsString := ActiveLetter.templateText; 
    n := rtfEditor.ReplaceTokens('[',']'); 
    rtfEditor.MergeText; 
    rtfEditor.refresh; 
    end;