如何將一具word格式的文件的內容讀到Memo控件裡,或RichEdit控件裡。
如:c:\22.doc 寫到Memo裡。

解决方案 »

  1.   

    txt还好说,word试了很多方法,还是不行,都是乱码
      

  2.   

    var
        Word:Variant;
        activerow: integer;
    begin
        Word:=CreateOLeObject('Word.application');
        word.documents.add(Template:='f:\mynew.ttk.dot');
        word.selection.endkey;
        newword.activedocument.Paragraphs.add;
        activerow:=newword.activedocument.Paragraphs.count;
        newword.activedocument.paragraphs.item(activerow).range.text:='哈哈,加进去了。';//这里加入
    end;能加进去,就能读出来了,你应该会了,呵呵。
      

  3.   

    netlib(河外孤星) 是用ole读,我怎么没想到