如何把word文件的内容在delphi开发的程序From中显示(要求保留word中绝大多数的格),本人考虑过写到Richedit中,但不会.

解决方案 »

  1.   

    我用OLE,但我没有读取格式。
      

  2.   

    用OleContainer:
    if OpenDialog1.Execute then
           OleContainer1.CreateObjectFromFile(self.OpenDialog1.FileName,false)
        else
          exit;
        OleContainer1.DoVerb(ovPrimary);
      

  3.   

    谢谢sxqwhxq(步青云),我已经把1.doc导到OleContainer1了,那我能不能对1.doc进行修改,保存等操作.
      

  4.   

    用RICHEDIT是不能满足WORD格式文档的要求的,
    我现在也是在用OleContainer,但是在读取OleContainer中的信息到流的,然后再保存到数据库中的时候出错。
    关注中
      

  5.   

    procedure TForm1.Button4Click(Sender: TObject);
    //disk->show
    begin
      OleContainerFY1.CreateObjectFromFile('d:\abc.doc',false);
      OleContainerFY1.DoVerb(ovShow);
    end;可通过procedure TForm1.Button4Click(Sender: TObject);
    //disk->show
    begin
      OleContainerFY1.LoadFromFile('d:\abc.doc');
      OleContainerFY1.DoVerb(ovShow);
    end;
    这个为什么不能通过?(ole error 80030050)
      

  6.   

    OleContainer.SaveAsDocument('filename');//filename是你正在编辑的文件
    别忘记给分,最好全给!
      

  7.   

    用OleContainer:if OpenDialog1.Execute then
           OleContainer1.CreateObjectFromFile(self.OpenDialog1.FileName,false)
        else
          exit;
        OleContainer1.DoVerb(ovPrimary);
      

  8.   

    哪位能举下OleContainer1.LoadFromFile的?要不结贴了:)
      

  9.   

    ole打开的文件好象不能保存的,我以前也测试没通过!