WPCubed Product Support

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

#1 ♥ 0
3.9k Views 2 users read 1 min
support

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

#2 ♥ 0

Hah, I was close.

Thanks Julian, this will work perfectly!

#3 ♥ 0
This category is archived. No new posts are possible.