Page 1 of 1

LoadRTF unexpected results

Posted: Sat Oct 09, 2010 2:00 am
by GerryD
I'm checking out the trial version of tRichVeiw for Delphi 2007. I can load an RTF file but the results are not what I expected. The display is a single font and text that was supposed to be bold is being displayed in blue.

Here's my code.

begin with RichViewTest do
begin
Clear;
DeleteUnusedStyles(True,True,True);
if loadRTF( 'RV.rtf') then
begin
Format;
end;
end;
end;

I'm using the default RVStyle component for my tRichEdit control.

Any help would be appreciated.

Posted: Sat Oct 09, 2010 6:27 am
by Sergey Tkachenko
Make sure that

Code: Select all

RichViewTest.RTFReadProperties.TextStyleMode = rvrsAddIfNeeded;
RichViewTest.RTFReadProperties.ParaStyleMode = rvrsAddIfNeeded;
PS: if LoadRTF returns False, document may be partially loaded, so you still need to call Format.