Mailmerge - insert graphic

  • I just tried to insert a TGraphic (TMetafile image) into my Editor, but didn't get it working

    My first try was to find the Mailmergefields

    Code
    mmList      := TWPTextObjList.Create;        RichText.FieldGetList(mmList, TRUE);        for i:=0 to mmList.Count-1 do begin            mmItem  := mmList[i];CopyChartToFile('d:\test.png');// Here also tried per stream or as EMF ....                 wpObj   := TWPOImage.Create(RichText.Memo.RTFData);(* Also tried                wpobj := TWPOImage.Create(tempDokument.RichText);                wpobj.Graphic := tempGraphics;//Image1.Picture.Graphic;                wpobj.WidthTW := wpobj.ContentsWidth;                wpobj.HeightTW:= wpobj.ContentsHeight;*)                wpObj.LoadFromFile('d:\test.png');                mmItem.ObjType  := wpobjImage;                mmItem.objRef   := wpObj;(* Also triedmmItem.LoadObjFromFile('d:\test.png');*)            end;        end;        mmList.Free;

    -> All theses treis didn't do anything ... nothing appears on the resulting document


    And i treid it also in the mailmerge event
    Here also tried as PNG or as EMF, per file and per TStream


    After this the whole document is duplicated -> all text are twice and the image of the charts is twice, but the first appearance of the image only a playeholder is seen (no image only the border)

    What i am doing wrong?

  • Just found the problem

    It was nothing with generating the Text, it was the viewer,
    The viewer loaded the WPT Text, and than the GNU-Get Text unit tries to translate the text per RTTI and after that the text was wrong!