Merged Text lost the header footer and outlines

  • I'm using the latest 6.x version of the vcl. When I am doing the merge, I lost header/footer or outlines.

    Scenario #1 (this code Lost both of the header/footer and outline)
    WprichText1.OpenDialog(wpdiaload);
    wpRichtext1.clearEx(true, false,true);
    Wprichtext1.mergeText;
    wprichtext2.fastAppendText(wprichtext1,false);

    Scenario #2 (this code Lost the header/footer, outline is correct)
    WprichText1.OpenDialog(wpdiaload);
    wpRichtext1.clearEx(true, false,true);
    Wprichtext1.mergeText;
    wprichtext2.heder.assign(wprichtext1.header);
    wprichtext2.fastAppendText(wprichtext1,false);

    scenario #3 (this code lost the outline, the header/footer is correct)
    WprichText1.OpenDialog(wpdiaload);
    wpRichtext1.clearEx(true, false,true);
    Wprichtext1.mergeText;
    wprichtext2.hederfooter.assign(wprichtext1.headerfooter);
    wprichtext2.fastAppendText(wprichtext1,false);

    What is correct coding to keep both? I have tried a few other way, but not successfull. I must missing something on the coding. Please HELP...

  • correction on the code sample code send...

    I'm using the latest 6.x version of the vcl. When I am doing the merge, I lost header/footer or outlines.

    Scenario #1 (this code Lost both of the header/footer and outline)
    WprichText1.OpenDialog(wpdiaload);
    wpRichtext2.clearEx(true, false,true);
    Wprichtext1.mergeText;
    wprichtext2.fastAppendText(wprichtext1,false);

    Scenario #2 (this code Lost the header/footer, outline is correct)
    WprichText1.OpenDialog(wpdiaload);
    wpRichtext2.clearEx(true, false,true);
    Wprichtext1.mergeText;
    wprichtext2.heder.assign(wprichtext1.header);
    wprichtext2.fastAppendText(wprichtext1,false);

    scenario #3 (this code lost the outline, the header/footer is correct)
    WprichText1.OpenDialog(wpdiaload);
    wpRichtext2.clearEx(true, false,true);
    Wprichtext1.mergeText;
    wprichtext2.hederfooter.assign(wprichtext1.headerfooter);
    wprichtext2.fastAppendText(wprichtext1,false);

    What is correct coding to keep both? I have tried a few other way, but not successfull. I must missing something on the coding. Please HELP...

    • Offizieller Beitrag

    This is what the MailM4 demo does:

  • The outline still doesn't work (the bullets are missing). And the page header/footer doesn't display:

    Here is the code:

    WPRichText2.asString:=WpRichText1.asString;
    WpRichText2.clearBody;

    while not vTable.eof do begin
    wpirchText1.mergeText;
    section:=wpRichText2.FastAppendText(wpRichText1,true,[wpCreateNewPage]);
    section.Select:=[wpsec_resetOutlineNums, wpsec_resetPageNumber];
    vTable.next;
    end;


    Result:
    Header/footer merged (the page number is not correct. Always show page 1).

    The outline is indented correctly, but the bullet indicator (solid dot) is missing.