Merging body text into existing document

  • Hi

    Im trying to implement a method that can merge the bodypart of a document (stored in the filesystem) at the end of an existing document. The existing document can be with/without header/footers information, but at all time only bodypart should be merged. I made the following methods but even though the merge-memorystream contains data, it doesn't seem to get inserted. What Im I doing wrong, or should I do it in another way?

    FYI, the document are .rtf poss. with unicode text.

    • Offizieller Beitrag

    Hi,

    a) instead of
    rteTmpEditor := TWPRichText.Create(Self);

    use rteTmpEditor := TWPCustomRTFedit.CreateDynamic;

    b) rteEditor.LockScreen; is superfluos

    if rteTmpEditor.SaveToStream(stmMergeFile, 'RTF') then
    begin
    stmMergeFile.Position := 0; 
    rteEditor.LoadFromStream(stmMergeFile, 'RTF');
    end;