Plain text for Word Count

General TRichView support forum. Please post your questions here
Post Reply
joeb545
Posts: 2
Joined: Sat Dec 13, 2025 4:14 pm

Plain text for Word Count

Post by joeb545 »

I want to display a word count in my application. I have an algorithm to calculate this that requires plain text. How do I get plain text from a TRichViewEdit?
Sergey Tkachenko
Site Admin
Posts: 18001
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Plain text for Word Count

Post by Sergey Tkachenko »

See this topic for functions for calculating word count: viewtopic.php?t=13

As for plain text, there are several methods.
For this task, the best function is RVGetTextRange(rv, 0, RVGetTextLength(rv)) from RVLinear unit, see https://www.trichview.com/help/idh_rvlinear.html.
This function does not save text representation of non-text items (except for tables and tabs)
joeb545
Posts: 2
Joined: Sat Dec 13, 2025 4:14 pm

Re: Plain text for Word Count

Post by joeb545 »

Thanks. This works perfectly!
Post Reply