Z zhy1356 Unregistered / Unconfirmed GUEST, unregistred user! 2003-05-11 #1 如何在delphi中打开一个已经存在的word文档
C cwmdelpher Unregistered / Unconfirmed GUEST, unregistred user! 2003-05-11 #2 用CreateOLEObject创建word的ole对象,就可以控制word了 procedure TForm1.Button1Click(Sender: TObject); var MSWordlevariant; begin MSWord := CreateOLEObject('Word.Application'); MSWord.Documents.Open (FileName:='c:/newword.doc', ReadOnly:=False); //e:/newword.doc为已存在的word文件 MSWord.Visible := 1; end;
用CreateOLEObject创建word的ole对象,就可以控制word了 procedure TForm1.Button1Click(Sender: TObject); var MSWordlevariant; begin MSWord := CreateOLEObject('Word.Application'); MSWord.Documents.Open (FileName:='c:/newword.doc', ReadOnly:=False); //e:/newword.doc为已存在的word文件 MSWord.Visible := 1; end;