View Full Version : count lines in RTF object
gvanassche
10-13-2009, 12:41 PM
Dear all
Does anyone know how to count lines and words in an RTF object?
To count words I could count spaces, but I have no idea how to count the lines...
thanks
gert
longedge
10-13-2009, 01:01 PM
Doesn't the number of lines in an rtf file depend on the width of the display. The carriage return and line feed would normally be an end of paragraph as far as I know.
Sakuya
10-13-2009, 01:13 PM
Here you go.
Check the example attached.
longedge
10-13-2009, 01:59 PM
Check the example attached.
Searching for "\r\n" won't return a reliable result. Word wrapping depends on the space available to display the text so an rtf file when viewed on one machine with say Wordpad might have 20 lines of text and 3 paragraphs and on another have 18 lines of text. It will still have 3 paragraphs though.
gvanassche
10-13-2009, 02:22 PM
Sakuya, thanks for the demo! very usefull...
hamseda04
11-02-2010, 07:16 AM
hello
i,m need a code that for a line count.
for example:
line = a line count of RichText
if line == 10 then
result = Dialog.Message("Notice", line, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end
Powered by vBulletin™ Version 4.0.6 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.