In WPT4, we located and deleted lines if the line was blank due to a field being blank. I need to replicate this in 7, but am having a difficult time doing that. Here is the code in 4 (verify finds the position of the first char that is not in the substring after it, so first one that is not blank or <):
AllRTFText.Finder.Wildcard := '*';
AllRTFText.Finder.ToStart;
AllRTFText.CPPosition := 0;
NotDone := AllRTFText.Find('<',false);
while NotDone do
begin
VIdx := verify(trim(AllRTFText.CPline),' <');
if (VIdx = 0)
or (AllRtfText.CPLine = #10)
or (AllRTFText.CPline = #13)
or (AllRTFText.CPline = #10 + #13) then
AllRTFText.RtfText.DeleteLine;
NotDone := AllRTFText.FindNext;
end;