Header blank after saving; preview with header not as expect

  • 1. Using techniques from your demos, I can edit header, footer, body. However, after saving the rtf doc, header and footer appear to be blank. If I reload the doc from the file, they magically reappear. What am I doing wrong?

    2. In any case, the header & footer do not show up in the preview dialog & I have not discovered any properties that control this behavior. Note that if I am editing the header & then do a preview, the header is what I see in the preview. Likewise the other parts. But I cannot get all 3 parts to show in the preview all at once.

    Jeremy

    • Offizieller Beitrag
    Zitat von Jeremy

    1. Using techniques from your demos, I can edit header, footer, body. However, after saving the rtf doc, header and footer appear to be blank. If I reload the doc from the file, they magically reappear. What am I doing wrong


    I check that out - but I assume a ReformatAll is needed somewhere to recalculate the heihht of the "special texts".

    Zitat von Jeremy

    2. In any case, the header & footer do not show up in the preview dialog & I have not discovered any properties that control this behavior. Note that if I am editing the header & then do a preview, the header is what I see in the preview. Likewise the other parts. But I cannot get all 3 parts to show in the preview all at once.

    I think it is the same as in 1) Did you check out the sourefile wpManHeadFoot.pas - it is used by 'wpdemo' for manage header/footer menu.

    I hope this helps,
    Julian

    • Offizieller Beitrag
    Zitat

    Reformatall did seem to help with editing, but not with preview.

    I suspect the header is not being carried into the merged document.

    No, it isn't. You are using FastAppendText which only appends the text which is 'active' in the editor. (See property WorkOnText).

    To transfer all special texts you can use

    Code
    WPRichText2.AsString := WPRichText1.AsString;
    WPRichText2.ClearBody;


    Info: V4.20a or later will also support: WPRichText2.HeaderFooter.Assign( WPRichText1.HeaderFooter );

    Julian

  • >WPRichText2.AsString := WPRichText1.AsString;
    >WPRichText2.ClearBody;

    The above doesn't do it. The preview shows a bunch of gibberish along the left margin, as if the printable width is 0. I did a fastcopy of properties, but that didn't make any difference.

    > WPRichText2.HeaderFooter.Assign( WPRichText1.HeaderFooter );

    This one throws an error "Cannot assign a TWPSpecialTextProperty to a TWPSpecialTextPropertyContents."

    Jeremy

  • I changed the following

    > WPRichText2.HeaderFooter.Assign( WPRichText1.HeaderFooter );

    to

    WPRichText2.rtftext.Assign( WPRichText1.rtftext);

    The program no longer throws an exception, but the preview still only shows a bunch of junk in the left margin.

    Jeremy