Hi Julian,
I want to get the number of characters in the body when a document is opened or closed. Is there a property available or Should I select all the body to get the length?
thank you.
Hi Julian,
I want to get the number of characters in the body when a document is opened or closed. Is there a property available or Should I select all the body to get the length?
thank you.
Take a look at the wpdocpropdlg.pas unit. There you will find how to count the characters, including or excluding blanks.
The simplest count method is
GetTextLen
if you need something spacial create a loop over all paragraphs and count the characters in a loop:
par := WPRichText.BodyText.FirstPar;
while par<>nil do
begin
for i := 0 to par.CharCount-1 do
begin
if not par.IsSpace(i) then inc(count);
end;
par := par.next;
end;
the above ignores space when counting.