gaoql好, 那是否可以保留rtf文件原來的段落格式?

解决方案 »

  1.   

    那就先读入,然后把所有的格式全部去掉,再判断(有点麻烦)
    var
      temp: TMemoryStream;
    begin
      temp := TMemoryStream.create;
      richedit1.lines.beginupdate;
      try
       richedit1.plaintext := false;
       richedit1.lines.loadfromfile('abc.rtf');
       richedit1.lines.savetostream(temp);
       richedit1.plaintext := true;
       richedit1.lines.loadfromstream(temp);
      finally
      begin
       temp.free;
       richedit1.lines.beginupdate;
      end;
    end;
      

  2.   

    sorry, 第二个 beginupdate 应该为 endupdate;现在可以判断行数了,关于如何判断,我在你的另一张帖子上回答了
      

  3.   

    mophy你好,如果保持其格式, 有沒有其他方法?