Fastest way to search for text in RVF files?

General TRichView support forum. Please post your questions here
Post Reply
Posts: 57
Joined: Tue Jul 13, 2010 10:50 pm

Fastest way to search for text in RVF files?

Post by PeterPanino » Sun Apr 15, 2018 2:34 pm

Which is the fastest way to search for a simple text string in a bunch of .RVF files?

Is there a specialized function for this or do I have to load each RVF file in a TRichView and search the text in it?

Sergey Tkachenko
Site Admin
Posts: 14827
Joined: Sat Aug 27, 2005 10:28 am

Re: Fastest way to search for text in RVF files?

Post by Sergey Tkachenko » Sun Apr 15, 2018 4:45 pm

There are no functions for searching text in RVF files, sorry. You need to load them one by one.
The slowest procedure is formatting, and SearchText method requires a formatted document. So, if you need a fast search, avoid using SearchText, and create your own procedure for searching text in TRichView. As a sample, you can use code enumerating all text items, from here: ... items.html

If you expect that search will be performed often, I suggest to saving a text-only copies of documents. You can use functions from RVLinear unit:
Text returned by RVGetTextRange has 1:1 correspondence to the document. So, if you find a text string in this text, you can select it in the document.

Post Reply