I need to read a document from end to end, looking at each paragraph and right term to replace it without losing formatting.
Thanks,
Andreas
I need to read a document from end to end, looking at each paragraph and right term to replace it without losing formatting.
Thanks,
Andreas
What about setting the DefaultIOFormat to WPTools, capture the document in a string using .AsString, apply your replacements using StringReplace and then return to the document again using .AsString
Hi,
I recommend to create a loop like
par := WPRichText.FirstPar;
while par<>nil do
begin
par.SetText ...
par := par.Next;
end;
Inbetween you can uzse all the low level functions in TParagraph, set attributes, insert or change text etc.
Hello,
CPMoveDownPar moves the cursor - it is not a good way for programatic changes in the document.
If you want to work with the ActiveParagraph, you can still do
if WPRichText1.ActiveParagraph.next <> nil then
WPRichText1.ActiveParagraph := WPRichText1.ActiveParagraph.next
else break;