copy text from specific header

  • I've tried several ways of getting at this but can't seem to get it working.

    I have one header in my document, first page only.

    What is the most simple way to copy the lines of text from this header into a memo?

    I'm using the stringbuilder method to copy the body line by line as plain text. I just need to find a way to prepend the body with this one header's content.

    Thanks

    • Offizieller Beitrag

    Hi,

    Memo1.Text :=
    WPRichText1.HeaderFooter.Get(wpIsHeader, wpraOnFirstPage, '').RtfText.AsANSIString('ANSI');

    should do it.

    You can alos use SaveToStream - You would not need the stringbuilder then.

    Regards,
    Julian