Cannot view imported(from doc) file

General TRichView support forum. Please post your questions here
Post Reply
Alextp
Posts: 46
Joined: Sun Apr 24, 2011 8:21 am

Cannot view imported(from doc) file

Post by Alextp »

Created Office converter component (name R). Imported .doc to Stream (ImportRTF method, result true, Stream.size is 25K so imported Ok)

Now call RichView.LoadRTFFromStream(R.Stream). Richview empty. Why? LineCount=0
Alextp
Posts: 46
Joined: Sun Apr 24, 2011 8:21 am

Post by Alextp »

Code: Select all

begin
  if not R.ImportRTF('d:\t\1.doc' , n{4}) then ShowMessage('import');
  R.Stream.Position:= 0;
  RR.Clear;
  if not RR.LoadRTFFromStream(R.Stream) then ShowMessage('load');
  R.Stream.SetSize(0);
end;
RR- richview. 13.0.1
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Call RR.Format at the end.
Alextp
Posts: 46
Joined: Sun Apr 24, 2011 8:21 am

Post by Alextp »

ok. I found possible bug: if i import file to Richviewedit, not same styles applied to lines in file. Some styles the same, some not. 'Styles' prop is the same (in RV, RVE). I can send .doc file
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

First, make sure that properties of RR allows adding new styles when importing RTF.
RR.RTFReadProperties.TextStyleMode must be equal to RR.RTFReadProperties.ParaStyleMode must be equal to rvrsAddIfNeeded.

If they are equal, but the problem still exists, send this doc to me to richviewgmailcom.
Alextp
Posts: 46
Joined: Sun Apr 24, 2011 8:21 am

Post by Alextp »

Were not set. Ok now
Post Reply