Header/Footer dissapear after super merge

  • I have looked at some of the other posts on the forum but still cannot get the headers/footers to carry over, let alone headers with merge fields in them.

    Here is the code I pulled from another post:

    Code
    WPMergedText.Clear();
         WPMergedText.Header.Assign(WPSourceText.Header);
         WPMergedText.AsString := WPSourceText.AsString;
         WPMergedText.ClearBody();
         WPSuperMerge.Execute();

    But it still doesnt pull over any text that is in the header or footer.

    Any help would be appreciated as this has been a pain in my side for a while.

    Thanks

  • You are correct that was v5 code, but after your suggestion it still seemed to work, so Ill stick with it unless you suggest something better.

    Next problem is merge fields in the header/footer not merging over. I again tried to use the code that you suggested from the other post (The version 5 code):

    Q: ... SuperMerge component doesn't process merge fields in the header/footer - is it possible to fix this?

    A: SuperMerge cannot process the fields but the destination WPRichText can. SImply assign an event handler to DestText.OnMailMergeGetText (this can be the same as used for TWPSuperMerge!) and call
    DestText.MergeText(true) before you do the SuperMerge.Execute.

    But that doesnt seem to work. What would I have to do for version 4 in order to make it work?

    Also, when A user uses header/footer bands and saves the merged text, then reopens the text for editing, the header footer bands are replaced by the old header/footers. Any way to have it have the bands when the re-edit (for lcak of a better word)?

    Thanks for your help.

    • Offizieller Beitrag

    Hi,

    SuperMerge ist not designed to merge in header/footer. It was created to create new header and footer through header and footer bands.

    If you use standard header/footer, copy them over to the destination that you can use the standard Dest.MergeText() method.

    If you change the WorkOnText property for header(footer, You can merge in header and footer too.

    V5 has a MergeText(true) call to merge in all texts.

    Juliabn