Loop through existing HeaderFooterTextRange

  • This is what I'm doing now to merge. I'll also need to do this for a character counting procedure since GetTextLen doesn't count headers or footers. Is there a way to loop through the available HeaderFooterTextRanges without having to try every possible one there might be? This works but seems damn inefficient. I don't have the footers in there yet but they will be added as well.

  • To expand on this, is it possible to do 'just' headers or 'just' footers in a similar loop?

    for i:=0 to Form1.WPRichText1.HeaderFooter.Count-1 do begin

    like a header.count etc